EntityFramework6.0 Reading Notes [1] ----- preface, entityframework6

Source: Internet
Author: User

EntityFramework6.0 Reading Notes [1] ----- preface, entityframework6

Entity Framework is Microsoft's strategic data access technology. Unlike earlier access technologies, Entity Framework is not coupled in Visual Studio. It provides a comprehensive, model-based ecosystem, allows you to develop applications including desktop, Internet, cloud computing, and service-based.

History

EFVersion1Supports Database Frist

EFVersion4Supports Database Frist + Model First [along with full Plain Old CLR Object (POCO) support and
Default lazy loading behavior]

EFVersion4.1 1EFVersion4. 3Supports Database Frist + Model First + Code Frist

EFVersion5Improves performance, supports enumeration, table-valued functions, space types, and stored procedures [This is restricted to Database Frist]. It is further integrated with the MVC framework.

EFVersion6It provides asynchronous queries and updates, and supports stored procedures in CodeFrist to improve performance and introduce some new features.

Model

When you use EntityFramework to create a Model, the most significant feature is to create an Entity Data Model (EDM). You can use EDM to customize the ing between Entity classes and Data tables.

Developer: you only need to focus on the development of the domain object model [class that can intuitively describe specific problem Information]

DBA: more databases are designed based on performance, scalability, maintainability, and high standardization.

For example, the Employees, Devices, and Phone information in the table are stored in three different physical data tables. This is from the DBA's perspective, the set information of Devices and Phone is included in the Employee class. Similarly, DBA places all information related to the Department in a Depeartment table, based on the development concerns, the developer divides it into (accounting, marketing, finance, and other specific entity objects ). That is to say, from different perspectives, developers do not care about how DBAs design data tables or how developers design entity classes. They may be in the same project group and have their own roles. They can optimize their own solutions without affecting full decoupling, and the interaction work is handled by EntityFramework.

Layer

The Entity Data Model consists of the concept layer, storage layer, and ing layer. Each layer is independent of each other.

The entity class is included inConcept Layer[Conceptual layer], which is also the most concern of developers. You can also use the built-in EntityFramework tool for reverse engineering, that is, to create an entity class from an existing database. The syntax used is the conceptual Architecture Definition Language (CSDL ].

Object Data ModelStorage layerDefines how tables, columns, relationships, and data types are mapped to the underlying database. The syntax used is the storage Architecture Definition Language (SSDL ).

Ing LayerDefines the ing between concepts and storage layers. This layer defines how to map attributes of an object class to columns in a database table. This layer is exposed to developers. developers can use EntityFramework to design the window or data annotation Method for ing detailed information, and use Fluent API to define Code Frist, the syntax used is the ing standard language (MSL)

Terms

EntityTypeRepresents a class in the domain model. An instance of EntityType is usually called an entity. If you are using the EntityFramework designer, you can see the representation shown in. EntityType usually has one or more attributes. A property can be a simple type, such as an integer, a string, or a complex type, or a set.Navigation PropertiesUsed to associate other related entities (usually expressed in foreign key relational databases ). Non-Navigation attributes are calledScalar property.

The relationship between two entities is calledAssociation. Associations between entitypes are displayed as a line connecting EntityTypes in the design view.

 EntityTypeThere is an attribute or a group of attributes representing itsEntityKeyAttribute. An EntityKey uniquely identifies the object, which is most often mapped to a primary key of the underlying database.

 Context objectIs the gateway for obtaining the EntityFramework service. Manage database connections, generate parameterized SQL statements, execute data access, cache objects, and convert trace and abstract data to entity classes that contain specific parameter types.

DbContextIs a kind of packaging of ObjectContext supported by EntityFramework, so it is more intuitive and friendly.

How to code

1. EF/VS relies on the T4 template to automatically generate code

2. Use the CodeFrist mode to manually write a POCO class independent of the EntityFramework pipeline [reverse generation using Entity Framework Power Tool ].

 


The teacher asked us to make a book with diaries, Reading Notes, and compositions. How should we write the preface? Can you help me?

This is the simple order I wrote for the student diary set. You can use it after you change it.
Student diaries
Composition is an important means of communication with everyone for life. At present, "difficult composition" has become a major challenge in Chinese teaching in primary schools. The students read the composition very mysteriously. When talking about the composition, they had a headache. They looked at the teacher's questions and racked their brains. They didn't know what to write or how to write them. Although the teacher has spent a lot of effort, it has little effect.
How can we help students get out of the predicament and take a good step on the way to composition? In my opinion, the most fundamental thing is to make the initial stage a source of vitality and inexhaustible power. It is undoubtedly the best way to cultivate students' ability to write diaries.
Writing a diary can not only cultivate the observation ability, enrich the students' language accumulation, cultivate the sense of language, improve the communication ability, and help students understand the world, society, and life. Based on the above understanding and the school's "", I edited my "growth footprint" portfolio, which has the following features:
1. This diary is extensive in content, involving people, notes, scenes, objects, and Travel Notes.
2. wide participation of students. This diary contains more than XX articles.
3. The selected text is short and suitable for students to read.
4. Let go of your imagination. It is another feature of this diary set. Students are not only interested in writing diaries, but can write down what they want and can write, and have developed the habit of saying "Be honest with yourself.
When reading this diary set, you can either systematically observe an article, arouse your interest in writing, or gain profits from a certain type based on your actual situation.
Due to the rush of time and the limited level of editors, it is inevitable for the students to concentrate on their shortcomings and errors. The viewer is willing to criticize and correct them.

Reading Notes

1 ...... Yu Qiuyu's "one sigh of the millennium" Reading Notes this is a diary that records the experience of Yu Qiuyu's hands-on cross-country journey of tens of thousands of kilometers to explore the ruins of all major civilizations of mankind. I haven't finished reading it yet. I followed the author's footsteps tonight and came to the Solomon stone column in Israel. Looking at the chapters that have already been read, there are a lot of sentences worth remembering: This is a bit like the current behavior art. Everything is done only in the Process of behavior and will not be painted out of behavior; it is also a bit like Chinese calligraphy. There are always a lot of regrets with a large stroke, but it is not appropriate to draw a picture in the East after the pen is collected. The root of the pan, mud and water stains are kept, the figure is real. (This is because the author is unwilling to delete any part after the manuscript is completed, in order to save its native and rough state .) The plane chased the night and was afraid of being caught up by dawn. So it was full of darkness for more than a decade. When it was not ready to fly, it stopped and dawn came with Athens. (This is a wonderful description of the author's departure from Hong Kong, stop in Bangkok, and then from Dubai to Athens !) See the Aegean Sea. Vast and undignified, gentle and not gentle, in the hot sunshine by the sea only need to borrow a few minutes of clouds, immediately cool. (I feel like a simple ancient sea .) Aesthetic timidity is a strange kind of mood, most of which will not be seen from small well-known images. When I was young, I went straight forward with joy. When I was older, I learned that there were not many such things in the world. If I saw one, I would lose one, so I became more and more cherished. I am afraid that I will not be able to see it. I am afraid that I will not be able to prepare myself when I see it. This will waste a great opportunity. (Although I am not older, sometimes there is such a mood. For example, if you see an extremely beautiful article, you will not be willing to read it at will. You always want to find a gentle evening, prepare a pot of tea, and finish your work with a word, but you can't find such a night, so you can cherish it .) Mafuz sat here and looked out every day, and a small hanging fan was slowly rotating. The oil-stained roof is too low and almost encounters a tall head. But he saw the window in the downtown area, the small table in the window, and the quiet side of the table. (This reminds me to review the boundaries between the advantages and disadvantages of writers: small space, large vision, or small experience .) In fact, this kind of damage occurs in the dark every day, but mafuz is famous, and the gangsters are seen at the very beginning. We do not know the name of the gangster, but more importantly, many potential protagonists in the history of human civilization have been missing from the gangster. We do not know their names. (Alas, this is the sorrow of little people !) 2 ...... my cultural journey-"one sigh of the millennium" Reading Notes (updated with emotions) My cultural journey's preface has been reading Yu Qiuyu's book recently, a strange sensation, I am also on this cultural journey. Although material reasons make me unable to go to so many places like Yu Qiuyu, my thoughts do not cover national boundaries, but do not cover time and space, I want to go abroad with his (Yu Qiuyu, which is the case below) Millennium one sigh, proving that I have learned more, the order of the following articles will follow the Chapter of the millennium sighs, starting from the third article mourning Greece, until it is written or I give up ^_^. 1. Greece has always been my favorite place. When I was 16 or 17 years old, I learned that I would settle in Greece in the future. I'm not going to discuss the scientific superstition of the dish fairy. At least I'm glad to hear that. Greece, in my mind, is able to compare with Chinese culture, can be said to be the birthplace of European civilization. I seldom read books other than Chinese classical culture, but I have always been interested in ancient Greek philosophy. Socrates-I want to be a midwife of human thoughts. I am a cool-man who stabbed Athens and later died like a mocking democracy, I was deeply impressed by all these ideas. Plato's "ideal country" has read a little, but he gave up because it is a dialogue, but he still knows some of his ideas and ideas. rational society, human beings always pursue a perfect rational society because of their imperfections. the metaphor of cave culture affects me. Aristotle's philosophy has hardly seen it, but what I'm most curious about is the cultural differences between China and the West. He is a philosopher and scholar, but he is also a scientist. It is strange that Chinese thinkers seldom go deep into the scientific field, they care about the relationship between people and political systems. Is it because of this difference thousands of years ago that modern China will surely be infiltrated by low-cultural powers? He mentioned a section in the "Don Juan" written by Baron, which was later translated by Su Manshu into the "Miss Greece"... the remaining full text>

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.