Entity Framework Code First series 1

Source: Internet
Author: User

Not long ago, I saw the news that Microsoft was preparing to open-source the Entity Framework. As soon as it was open-source, more students will definitely join the learning Entity Framework Team, therefore, I will write down some of my understanding of Entity Framework. I hope you can discuss it together. More importantly, you can also become more familiar with the EF Framework through this process, let's talk about the outline first.

Content outline of this series

  • Code First --- Hello World
  • Conventions and configurations
  • Entity Framework & Database

Code First, past and present

. NET 3.5 and Visual Studio 2008 bring the first iteration version of Entity framework, and bring reverse engineering capabilities to developers, you can use the visual studio designer to map a DataBase to a domain model to view the DataBase and user-defined DataBase model-DataBase-First mode. in. entity framework in NET4 and visual studio2010 has the second version: Entity framework 4, in this version, we can use the visual studio designer to create a domain model based on the EDMX file and synchronize it to the database, this allows developers to focus on the domain Model rather than the database design-Model First Model. At the same time, another mode Code First is introduced. The defined domain model is described through Code files instead of EDMX. In Code First, you can define the POCO file by yourself, instead of using the designer or other.

When to select Code first

The three modes are one of the ways to create the Entity Data Model, and the method for executing the model creation is the same. Therefore, you can choose to use only the one that looks at your preferences and project scenarios.

I probably listed the scenarios that are more suitable for Code First. Of course, this is not absolute. For example, I have a special liking for Code first.

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.