Entity Framework 4.1/4.3 (concept)

Source: Internet
Author: User

Entity Framework 4.1/4.3 One (concept)

Preface:

Hello everyone, I want to die for you. Because I want to write an article on the Entity Framework series, I wrote the preface here. On the one hand, I want to talk about the starting point of my article series, and on the other hand, I want to talk about the writing ideas. I haven't published any articles in the blog garden for a long time, and most of the time I am serving as a visitor. There are depth, breadth, attraction, and focus. These are the reasons why I like blog parks.

 

1. starting point: I have used the Entity Framework in. Net Framework 3.5 (In this article, we call it Entity Framework 3.5 ).

At that time, it was quite good to use and the development efficiency was improved. The developer's focus was to move from the database to the table object (that is, the data Entity of Entity Framework 3.5, is the object ing of the database table), but I have to say that the Entity Framework 3.5 at that time was still a preliminary product and there were many shortcomings. Many of these deficiencies have been improved in Entity Framework 4.1. Entity Framework is very powerful and more flexible, so I have full confidence in Entity Framework 4.1. This is also the starting point for writing this article.

Supplement: there are already a lot of such series of articles on the Internet. The most important starting point of my writing this series is also a summary of this series.

 

2. Train of Thought: In the series of articles, I will start with the concept and then implant the instance, and introduce the improvements and advantages of Entity Framework 4.1 Compared with Entity Framework 3.5.

 

Body:

Tip: Don't worry about these concepts that are filled with a large number of English words and abbreviations. You just need to understand them first. After the series of articles, these damn concepts will naturally be understood.

Sometimes when the concept is depressed, you can say "Fuck" to let it go.

 

Concept

1. Entity Framework: The full name of Entity Framework is ADO. NET Entity Framework. It is an O/R Mapping solution developed by Microsoft Based on ADO. NET.

ADO. NET Entity Framework is mainly composed of Entity Data Model (EDM). The Data logic layer is divided into three layers: Conceptual Schema, Mapping Schema, and Storage Schema. Entity Client, object Context and LINQ can be used.

(1) Conceptual Schema: define the Conceptual model (. csdl ).

(2) Mapping Schema: defines the ing between the storage model and the conceptual model (. msl ).

(3) Storage Schema: defines the Storage model (also known as the logical model ).

 

2. Code Frist

Code Frist refers to Code first. What is Code first? This idea is well reflected in Entity Framework 4.1. Write the business program first, and then generate the database and various data tables. However, I am used to creating databases and data tables first. Then, map to Entity Framework. I personally think this method is more reliable.

 

3. Poco

Poco is introduced in Entity Framework 4.0, called Plain Old CLR Oject/POCO ). The advantage of this is that the object can exist independently of the Entity Framework. (You may not understand it here. It doesn't matter. Never give it a point. You will suddenly realize it later ).

This independence allows Entity Framework to better support test-driven development and domain-driven development.

In fact, the idea of POCO is introduced from Java, which is not nice to say. Many of the good ideas in C # are introduced from Java. Here I am neutral. You can check POJO if you like.

 

4,LINQ to Entities

Supports Language Integrated Query (LINQ) to query object types defined in the conceptual model.

 

 5. ObjectContext

The definitions of ObjectContext on the Internet are many words, and it seems that they want to vomit blood. Let me talk about it. ObjectContext is a very important class library in Entity Framework. We understand it as a class library, which provides many methods to support our operations on Entity. That is to say, Microsoft has written a keystore library for us and we can call it.

 

 6. DBContext

DBContext is introduced in Entity Framework4.1. It is similar to ObjectContext. Someone asks, why does it introduce DBContext? Yes, I also want to ask this question. Microsoft explained to me that DBContext is lightweight, and DBContext is more lightweight, practical, and flexible than ObjectContext. I will present these advantages in subsequent articles.

 

7,Blog has this introduction, the URL is a very good http://kb.cnblogs.com/zt/ef/, share with you.

 

Continued at the end:

The advantages of Entity Framework are not described here. Why? I want to use facts to prove its advantages and advantages. I am not talking about today, but today I am talking about Entity Framework.

  

Well, after the basic concepts are introduced, don't worry about it. My opinion is that you only need to make an understanding of this article. In the subsequent articles, we will make a clear picture of the definition timeline.

Thank you for taking the time to watch. If something is not well written, please do not mean it. The younger brother accepts it modestly.

 

Bailing Note: copyright of this ArticleBailing and the blog Park are both owned by each other. For more information, see the source.
Helping others is the same as self-help! Mbailing@163.com

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.