MVC creates a data model using Database First (Databasefirst)

Source: Internet
Author: User

1. ORM Concept

2. EF's Databasefirst mode uses

1. ORM Introduction

Object Relational Mappings (objects relational Mapping, short ORM)

ORM Technical Features:

1. Improved development efficiency. Since ORM can automatically map the fields and properties of the entity object to the table in the database, we may not actually need a dedicated, large data access layer.
The 2.ORM provides a mapping of the database, without the direct encoding of SQL, to fetch data from the database as if it were an object.

2, EF (entityframework) Introduction

The ORM framework recommended by the ASP. EntityFramework is the "EF". It is the framework for official Microsoft development.

EF supports three ways to model data:

Datebase first (Database priority), model first, and code first.

1, Datebase First (database priority) mode;

Datebase first (Database priority)--project combat

Create a database

This is a table, if I database create a second table, add to here???

But no data model was found at the model level.

This is a Microsoft bug right now there are two ways to solve the problem, meaning to delete the model,

Re-add the second one is the two unknown right-click in the Models folder

Just need to right-click in these two places to run the custom tool.

1. The data model is stored in the/models directory of the project.

2, update the model from the data, the newly added table will not generate the corresponding code, you need to run the "custom tool" in two places

MVC creates a data model using Database First (Databasefirst)

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.