EF development mode (EF basic Series 9)

Source: Internet
Author: User

EF development mode (EF basic Series 9)

EF has three development modes:

1. Code First

2. Model First

3. Database First

Code First: In the Code First method, you completely avoid directly operating the Entity Designer (EDMX ). We started to write our own domain classes and use these domain classes to generate databases.

 

Model First: In Model First, you directly create entities, relationships, and hierarchy inheritance through the Entity Data Model (EDMX), and then generate databases based on your Model;

Database First: based on an existing Database, add an Entity Data Model and create an EDMX, context, and object class from the Database;

 

The Entity Data model can be updated at any time. When the database structure changes, DB First also supports views and stored procedures;

In practice, how should we choose the three development modes?

If you already have a domain class, use Code First to create a database based on the domain class. If you already have a database, you can use DB First, you can create an Entity Data Model through an existing database. If you do not have an existing database and you prefer graphical design, you can choose Model First.

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.