asp.net-mvc-5 – Hybrid Web Application (MVC and Web API)

Question:

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 both 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 in different projects within the same Solution?

Answer:

I don't see any problems working together, and that won't lead to poor performance. But everything in systems development has to be analyzed in depth, if it's a large MVC project with a diversity of code, two projects might be better, but then there's the inconvenience of publishing, you'd have to publish separately in a domain and a sub -domain, so there isn't that mess of applications (own experience).

So, analyze the environment, the amount of connection, the work and effort that the server will have to do, if it is a medium-sized project, it can do without fear. Larger projects the division would be the most ideal.

Scroll to Top