Mixing Web Api and ASP.Net MVC Pages in One Project

You can put them in separate namespaces, e.g MyApp.Controllers.UsersController and MyApp.Controllers.WebAPI.UsersController.

This would let you expose similar URI routes in MVC and WebAPI, eg:

/users/1      << MVC view
/api/users/1  << Web API

Leave a Comment