If you've used the ASP.NET Web API with prior versions of ASP.NET, you may recall that a Web API controller typically inherits from the APIController
. This has changed in the ASP.NET Core, as part of the unification of MVC and the Web API. As a result, each Web API controller inherits from the Controller
class, which is also the base class for each MVC controller.
In this chapter, we will work through a working sample of a Web API project. During this chapter, we will cover the following:
Web APIs
Web API configuration
Web API routes
Consuming Web API applications