官术网_书友最值得收藏!

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 can use any type of classes that you like, and in Chapter 5, Persisting Data with Entity Framework, you will learn how to use the Entity Framework (EF) core to work with classes that map to database tables and allow you to store data and query it.

主站蜘蛛池模板: 灯塔市| 原平市| 岚皋县| 星子县| 西安市| 道真| 南城县| 青神县| 泽库县| 大同县| 松溪县| 泗阳县| 大石桥市| 浮梁县| 宁都县| 宝清县| 顺义区| 班戈县| 蒲城县| 原阳县| 抚松县| 会东县| 大连市| 白河县| 南乐县| 桑日县| 全椒县| 共和县| 墨玉县| 北海市| 绥芬河市| 迭部县| 吉安市| 钦州市| 庄浪县| 巴林右旗| 汉寿县| 神农架林区| 锡林浩特市| 沙坪坝区| 兴和县|