ASP.NET MVC Routes

Posted by MVCDummy09 on Stack Overflow See other posts from Stack Overflow or by MVCDummy09
Published on 2010-04-23T04:56:47Z Indexed on 2010/04/23 5:03 UTC
Read the original article Hit count: 352

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mvc