Question

So I have been using http://attributerouting.net/ and love it. However, I cannot seem to wrap my head around when I should use RouteArea, or RoutePrefix, or both.

For instance, my thought is that with an API controller, use RouteArea("api"), and then for a prefix maybe use the main function of the controller? Any clarification would be helpful, thank you!

Was it helpful?

Solution

RouteArea is meant for use with MVC controllers, which have a formal concept of areas. In web api, just use RoutePrefix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top