How was the relationship between Web Api and Asp.NET MVC in Asp.NET 5?

11

In ASP.NET 4.6 or lower there were differences between Web Api and Asp.Net MVC. controller , for example, can inherit from controller or ApiController . However, with the arrival of Asp.Net 5 , it will not have this separation, the difference will be between AddMVC and AddWebApiConventions in services, as said in this article .

Have you really unified the two and if that's the only difference?

    
asked by anonymous 23.02.2016 / 18:46

1 answer

1

According to information on Scott Haselman's blog, the controllers in ASP Core were unified, so there are no longer Controller or ApiController classes, there is only one Controller that returns JSON or Views with HTML and has a unique structure for functions like routes, etc ...

The services.AddWebApiConventions(); method should be used to facilitate the portability of previous versions of the Api Web, this method is part of the Microsoft.AspNet.Mvc.WebApiCompatShim package that contains a ApiController class, this class has a structure that
08.09.2016 / 02:08