In the previous article, we analyzed several classes in the common, which are all auxiliary, in fact not very important, so that we have to analyze these categories today, including entity, Idatabase, ientitydataaccess, Entity, which is the base class for all entity classes, is the most important, while Idatabase and ientitydataaccess are services for the entity class.
First look at the familiar system structure diagram.
The three types of Entity, Idatabase, Ientitydataaccess are located in the business layer. The current class diagram for this layer is as follows:
As you can see from the diagram, the business layer contains both the blog and Blogclass entity classes, both of which inherit from the entity class, and each entity class (including entity) corresponds to a entension class. This class is naturally the place where the class-related extension method is stored, typically an extension of the IQueryable and Ientityaccess interfaces, and the Idatabase and ientityaccess two interfaces define methods for database access.
First, entity class. Entity is the base class for all entity classes and is a generic class in which a template class cannot be a struct body. It provides IDs, timestamp, and IsNew properties for all entity classes, Validate, save, and delete methods, each containing the actual operations validateaction, Saveaction, and Deleteaction.