Introduction to MVC Architecture-Model development, mvc Architecture-model
LEntity and IEntity attributes EntityId and IsDeleteInDataBase must be implemented in the derived class in an explicit way.
All attributes of the Model must have the corresponding default values before they are stored in the database. Do not rely on the default values of the database. We recommend that you add the New () method to the object to create an object before adding it. For example:
[PetaPoco. TableName ("spb_SampleEntities")] defines the ing between an object and a table in the database;
[PetaPoco. PrimaryKey ("ThreadID", autoIncrement = true)] defines the primary key of the table corresponding to the object and can be set to auto-increment type;
By default, all publicly disclosed fields will be mapped to fields with the same name in the table. If some attributes do not need to be stored, use [Ignore] For annotation. For example:
Instance product based on asp.net mvc 5.0 framework, source code: http://www.jinhusns.com/Products/Download