Introduction to the EF framework of MVC and the mvcef framework

Source: Internet
Author: User

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

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.