Hybrid Web application (MVC and Web API)

In Visual Studio when we create a web project it gives you the options to Mark:

WebForms MVC Web API

When I mark MVC + Web API the two are in the same project.

Are there any advantages / performance in using MVC + Web API in the same project or is it better to separate MVC from Web API into different projects within the same Solution?

Author: Joandreiy Cordeiro, 2015-10-08

2 answers

I see no problems working together, and that will not result in poor performance. But everything in systems development has to be thoroughly analyzed, if it is a large MVC project with a diversity of code, it may be better two projects, but, alas, it has the drawback of publishing, it would have to publish separately in a domain and a sub-domain, so that there is not that mess of applications (own experience).

Then analyze the environment, the amount of connection, the work and effort that the server will have to make, if it is a project up to medium size, can do without fear. Larger designs the division would be the most ideal.

 0
Author: Cezar, 2015-10-08 19:54:30

Exists. The complexity is less, the Scaffoldings of one are largely reused in the other, and the data context can be the same, avoiding major rework.

Separation should only occur if one disrupts the functioning of the other, in cases such as:

  • broken
  • permission
  • specific insulation needs
 0
Author: Leonel Sanches da Silva, 2016-08-13 18:48:35