From the course: Practical Application Architecture with Entity Framework Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Matching the model to the data

Matching the model to the data - Entity Framework Tutorial

From the course: Practical Application Architecture with Entity Framework Core

Start my 1-month free trial

Matching the model to the data

- [Instructor] Entity Framework requires that the EFCore model be compatible with the database schema. Ideally it matches the schema perfectly, but this is not always the case. There's an inherent duplication of information required for Entity Framework. Whenever information is duplicated, it can be mismatched. When the application and database are one to one, then Entity Framework can use migrations to become the source of truth. Database changes are made within the application and migrated to the database through Entity Framework. This solves the duplicated information problem and ensures the database and code always match. However it isn't always the case that the application can drive database changes. Often the application is hitting multiple databases, or databases that belong to other systems. This means that the application has to be updated when database changes are made. Re-scaffolding the data models with the database changes regularly means that the models are generated…

Contents