ASP.NET MVC Routes
- by MVCDummy09
Can I see one example that would make this piece of code compile?
public IEnumerable<RouteBase> Routes
{
get
{
return new List<Route>()
{
new Route(...)
}
}
}
What would you do if RouteCollection.MapRoute() didn't exist?
I'm trying to put my Controller in charge of mapping routes, not Global.asax.cs. public IEnumerable<RouteBase> Routes is a member of my Controller. If the Controller is responsible for a Route, it's a bad idea to decouple the Route by using routes.MapRoute() in Global.asax.cs.