This project is read-only.


Attribute routing value union is problematic


We currently take a union of the route values for action selection. This approach doesn't always work; sometimes it results in selecting the wrong action.

I'm guessing the right approach is for the uber-route to produce no values (except the sub-route) and for action selection to look at separate route values per action descriptor.

Also note that optional values that haven't been specified need to be removed both before this action selection logic as well as when elevating route data. (See RemoveOptionalParameters in HttpRoutingDispatcher).

public class TokensController : ApiController
    public string GetById(int id)
        return "id" + id;

    public string GetByName(string name)
        return "name" + name;

    public string GetDetails(int id, string name)
        return "id" + id + "name" + name;
GET of tokens/12 produces id12name instead of id12.
Closed Sep 4, 2013 at 8:58 PM by kichalla


davidmatson wrote Jan 24, 2014 at 6:38 PM

Fixed in changeset 2253a717171aebb053927551c5905a505e7573f9