Defining a Model

Chapter 17 presented the ASP.NET MVC application. Recall that, in this pattern, there is a Model that represents your business objects and their persistence layer. The Controller is used to manage requests and response from the HTTP traffic to your site. Views, of course, allow you to render a user interface (UI) to the user. The ASP.NET Web API service model leverages this same pattern. You define models for your data and a controller for handling service requests and response. (There is no real UI, of course, and hence no views.)

The framework for the ASP.NET Web API handles the plumbing of turning your model objects into serialized data that can be embedded in the HTTP response message. This serialization is typically JSON ...

Get Microsoft Visual Studio 2015 Unleashed, Third 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.