© Adam Freeman 2016

ADAM FREEMAN, Pro ASP.NET Core MVC , 10.1007/978-1-4842-0397-2_20

20. API Controllers

Adam Freeman

(1)Milton Keynes MK6 3PA, UK

Not all controllers are used to send HTML documents to clients. There are also API controllers, which are used to provide access to an application’s data. This is a feature that was previously provided through the separate Web API framework but has now been integrated into ASP.NET Core MVC. In this chapter, I explain the role that API controllers play in a web application, describe the problems they solve, and demonstrate how they are created, tested, and used. Table 20-1 puts API controllers in context.

Table 20-1. Putting API Controllers in Context

Question

Answer

What are they?

API controllers are like ...

Get Pro ASP.NET Core MVC, Sixth Edition 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.