Anthony Serdyukov
Anthony Serdyukov

Reputation: 4328

How to enumerate Areas in ASP.NET MVC 2 RC

My controller has to enumerate all the areas in the application. Is it possible? And how?

Upvotes: 0

Views: 224

Answers (1)

Arnis Lapsa
Arnis Lapsa

Reputation: 47627

From this issue, something like that =>

RouteTable.Routes.OfType<Route>()
            .Where(r => r.DataTokens != null)
            .Select(r => (string) r.DataTokens["area"]);

Upvotes: 3

Related Questions