Unified MVC and Web API in ASP.NET Core

One of the major architectural evolutions was the unification of MVC and web API in ASP.NET Core. There is no difference between the MVC and web API controllers in ASP.NET Core.

In the prior ASP.NET stack, the controllers from MVC and web API derived from their respective base controllers as follows:

    // ASP.NET MVC 5 Controller 
    public class HomeController : Controller 
    {  
      // Action Methods 
    } 
    // ASP.NET MVC 5 Controller  
    public class ValuesController : ApiController 
    {  
      // API Action Methods 
    } 
MVC and Web API unification

Both, ASP.NET MVC 4/5 and web API 2, have Controllers, Actions, Filters, Model binding, ...

Get Mastering ASP.NET Web API now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.