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)