Introduction to MVC Architecture-Model development, mvc Architecture-model

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.