Entity Framework - Data Persistence framework: Entity FrameWork
- Program through{Object Relational Mapping:ORM(Object Relational Mapping):created a "virtual object database" that can be used in a programming language}interacting with the Entity Framework, the Entity FrameworkADO Provider (Direct provider: SQL Server, Oracle,Indirect provider: OLE DB, ODBC)To interact with the database.
- Entity Framework creation, right-click Add New item in existing project in existing solution
Tim In addition, we get the edmx file ( edmx edmx file, we can know edmx xml file, we fold the node to get:
- folding through the nodes, we get edmx The overall architecture:
<edmx:Runtime> relationships to automatically generate CS code for entity classes, mappings, attributes, and more , expand edmx : Runtime,
<!--SSDL content--> the next is the physical model
<!--CSDL content--> the next is the conceptual model
The physical model and the conceptual model contain the same content, and the unique schema node consists of 3 parts, namely the entity container EntityContainer, the entity type EntityType (each entity generates one such node), Relationship Association (each foreign key relationship for a database generates one such node)
<!--c-s mapping content-->
mapping refers to the mapping of a physical model to a conceptual model , entity attribute corresponds to column name one by one
View the solution edmx the node also exists to TT The database context file for the extension, which exists under entities , all of our subsequent additions and deletions to entities are encapsulated in this class.
The Entity Framework is created in two forms, one is to get the Entity Framework from the database, the other is to get the database from the Entity Framework, and we can choose according to the actual situation.
Entity Framework Collection