EF Core
Getting started with EF Core
Getting started with EF Core
  • Introduction
    • What is an ORM
    • Entity Framework Core
    • EF Core architecture
    • EF Core Approaches
  • Basics of EF Core
    • Create the project
      • Create the model & context
    • Create migration
    • CRUD using EF
      • Creating many entities
      • Update & Delete
    • Adding a property
      • Add migration
  • Entity Relationships
    • Add related entity
      • Add Vehicle
      • Modify Student
      • Modify context
      • Add migration
    • Manipulate related data
  • Entity Configuration
    • Fluent APIs
      • Frequently used APIs
    • Data Annotations
      • Frequently used annotations
Powered by GitBook
On this page
  1. Introduction

EF Core Approaches

EF Core Approaches

Migrations

This approach used to be called as code first approach in legacy entity framework. In this approach the model drives all the changes to the database, this is more of developer centric approach where the code dictates terms! This is the suggested approach in all the projects except where the developers have no exclusive control on the database are the team is using the shared database with other teams.

Scaffolding

In this approach we reverse engineer the models from an existing database. All the changes are made in the database and we need to constantly keep scaffolding the changes on to the code. In legacy entity framework this was called data first approach. We use this when the database is shared across different teams, and we cannot have the code dictate terms on the database.

It is recommended to use migrations wherever possible since the framework can keep track of changes required for the database, reducing manual tracking and hence reducing errors which happen because of data impedance mismatch.

PreviousEF Core architectureNextCreate the project

Last updated 2 years ago