I am developing a web application , and the idea is to use ASP.Net MVC. The various web pages will rely on the data fetched from the DB , like list of employees , list of products.
- One way is we create a webAPI project , and expose the methods like GetEmployees(), and where ever on the view we need ,we directly fetch it through this web api.
But what if we don't create any web api project at all ? Instead in my MVC controller classes , i write methods that return a list of employees/products , which are then used on views through the AJAX .
What could be the possible drawbacks of this approach ?
Thanks