The model

The M in MVC means model, but what does a model really mean? The simplest definition is that model refers to the application problem-domain entities and their behavior, where behavior can be implemented in the entities themselves, or in a dedicated service class.

Classes that contain only properties with no logic are called Plain Old CLR Objects (POCO) classes. These are the type of classes that work best when received as input or returned as output from your APIs. It will save you many headaches if you stick to POCO classes in the external surface of your APIs. This will also keep you from making mistakes, namely exposing sensitive information such as your database structure, as your APIs grow. On the internals of your APIs, you ...

Get Hands-On Full-Stack Web Development with ASP.NET Core 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.