EntityFramework practice Overview, entityframework

Source: Internet
Author: User

EntityFramework practice Overview, entityframework

EntityFramework is a lightweight ORM framework developed by Microsoft. It is very convenient for some small projects, with almost no configuration and support for linq, so it is very easy to use, although I have been using EntityFramework for a long time, I have not had time to summarize and learn the EntityFramework system. Now I will sort out and summarize some knowledge of EntityFramework. EntityFramework has three modes:

1. Database First (Database First ).
2. Model First (Model First ).

3. Code First is also called Code only.

So what are the differences between the three models?

Database FirstIt is based on existing databases and uses some tools (such as the EF designer provided by Vs) to create entity classes and match the database objects with Entity classes, you can also manually modify the automatically generated code and matching files.

Model FirstIn this way, we first use some tools (such as VS's EF designer) to design the object data model and the relationship between them, then generate database objects and related code files based on these entities and relationships.

Code FirstIn this way, you must first write some code, such as object and data relationship, and then automatically create data according to the existing code description. However, this method is very similar to Model First. The code we write is actually to use code to represent the entity Model, while Model First describes the entity Model visually.

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.