Relevant route registration code:
routes.MapRoute(
"QuestionsMostRecent",
"questions",
new { controller = "questions", action = "most_recent" }
);
routes.MapRoute(
"ControllerActionFormat",
"{controller}/{action}.{format}"
);
Route generation code:
Url.RouteUrl(new {
controller = "questions",
action = "most_recent",
format = "rss"
});
I expect to receive "/questions/most_recent.rss", but instead I receive "/questions?format=rss". I realize I can force my expected result by referencing the route name "ControllerActionFormat", but I am curious about why exactly the routing system is matching the first route. Can anyone shed some light on this?