C
C#11mo ago
_vegabyte_

❔ Separation of .Net Core Web API and MVC in one soultion

HI, Is it possible to separate Web API and MVC projects? If yes how can I connect Web API to MVC? Any article and tutorials are much appreciated!
3 Replies
Florian Voß
Florian Voß11mo ago
an MVC pretty much contains an Api. The C in MVC is a Controller, which inherits ControllerBase, just like an Api controller would. I'm not sure what you wanna seperate, the Api is already seperated from the Models and the View when you follow regular MVC
Mayor McCheese
Mayor McCheese11mo ago
If you want to deploy a backend api separately, you can do that; but that would really be something like a data-service you're accessing for things like ajax/fetch calls If you're looking to separate out the controller portion of MVC that's a lot more challenging, it's doable, but likely you won't find tutorials on it and need to dig into the bowels of source code to figure out how to replace a number of lower-level automatic implementations.
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.