I have a multi tier MVC application that I need to add WebApi, in preparation for moving to .Net Core and a new set of controls for displaying data.
App built on .net 4.7.2, SammyJS (SPA), knockout (will be switched to React in time), and MS SQL Server.
The current architecture uses viewmodels and flows as follows;
Controller (MVC app) Service layer (business logic) Repository (data from SQL) Controller (MVC app) View (MVC app)
What I want to do is add in a Web Api controller class library, but unsure where it should sit in this process...
Do I call WebApi direct from the MVC app controllers, which then call the service, and associated repo respectively?
Do I leave my MVC app controllers calling the services, which in turn call the WebApi, and do away with my repositories?
I am a little confused on the best course of action due to never having to add WebApi into a service-repository design pattern.
Thanks, Simon
Not really tried anything as that is a massive code rewrite, but looking for the best approach!