How to find the right route in a RouteCollectionRoute?
I am testing ASP MVC routes . I am having an issue with attribute routes in ASP MVC 5.1 When I have a controller like this: public class FooController : Controller { [Route("foo")] [HttpGet] public ActionResult Get() { .... } [Route("foo")] [HttpPost] public ActionResult Post() { .... } } Then in order to test which route matches a particular request, I call routes.GetRouteData . I get a System.Web.Routing.RouteData that contains the route as well as values that should say which controller and action are matched. The problem is that this route is now an instance of RouteCollectionRoute this