Is it better to define all routes in the Global.asax than to define separately in the areas?
Posted
by
Matthew Patrick Cashatt
on Programmers
See other posts from Programmers
or by Matthew Patrick Cashatt
Published on 2012-10-03T16:42:38Z
Indexed on
2012/10/04
21:53 UTC
Read the original article
Hit count: 294
I am working on a MVC 4 project that will serve as an API layer of a larger application.
The developers that came before me set up separate Areas
to separate different API requests (i.e Search
, Customers
, Products
, and so forth).
I am noticing that each Area
has separate Area registration classes that define routes for that area. However, the routes defined are not area-specific (i.e. {controller}/{action}/{id}
might be defined redundantly in a couple of areas).
My instinct would be to move all of these route definitions to a common place like the Global.asax
to avoid redundancy and collisions, but I am not sure if I am correct about that.
© Programmers or respective owner