According to information on Scott Haselman’s blog, controllers in the ASP Core were unified, so there are no more classes Controller
or ApiController
, there is only one Controller
returning JSON
or Views
with HTML and has a unique structure for features such as routes, etc...
The method services.AddWebApiConventions();
should be used to facilitate portability of previous versions of the Web Api, this method is part of the package Microsoft.AspNet.Mvc.WebApiCompatShim
containing a class ApiController
, this class has a structure that mimics the Web Api of previous versions.
The method services.AddMvc();
adds the basic structure of MVC to the current version of ASP Core.
Sources:
https://docs.asp.net/en/latest/migration/webapi.html
http://www.hanselman.com/blog/ExploringAMinimalWebAPIWithASPNETCore.aspx
He managed to clear up his doubt?
– gato
@Denercarvalho I had forgotten this question, Sorry. I created it with informative character and I would put an answer myself but forgot. If you want to answer as well, it would help to have more content on the subject.
– Randrade