Introduction to the EF framework of MVC and the mvcef framework
Personal website address: nee32.com
I. Introduction to the Entity Framework (EF)
The EF framework is a data persistence layer framework. Its full name is ADO. NET Entity Framework, developed by Microsoft Based on ADO.. net orm (Object Relational ing, Object relationship ing) framework. Common data persistence layer frameworks include Nhibernate and ibaties.
Ii. EF core Entity Data Model
To use EF in MVC, first create an MVC4 Web application, and then add an ADO. NET object data model (edmx file), select the entity generated from the database (created First in the DB First database), as shown in
Enter the database login name and password to log in and select the database to connect to, as shown in figure
Directly, the XML file and an entity class are automatically generated for each table in the database. Let's take a look at the generated EDMX file.
Right-click the EDMX file and use the XML text editor to view it. In fact, EF is essentially an XML document.
It defines three parts of the data: SSDL content (Database Table), CSDL content (class), and C-S ing (class and table ing), the following are the contents
1. SSDL content (database table)
2. CSDL content (class)
3. C-S mapping (ing between classes and tables)
The following are the classes generated by EF.
How are these classes generated? Next chapter introduction to the EF framework of MVC T4 Template