From the course: Introducing Entity Framework

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Working with an existing database

Working with an existing database - Entity Framework Tutorial

From the course: Introducing Entity Framework

Working with an existing database

Hi friends. Welcome back to Entity Framework Core for Beginners. In our previous video I showed you how easy it is to use Entity Framework Core migrations to create and work with a new database. First, we defined our entity model in code. Then we used migrations to change the database as we made changes to the model. When we use that approach, we're treating the code as the authoritative source of truth regarding the shape of our entities. In this video, I'm going to show you how to use Entity Framework Core to work with an existing database by reverse engineering it. This approach treats the database as the source of truth. Looking at Visual Studio, I have a brand new console app that doesn't have any code added to it at all. I've already added the Microsoft.EntityFrameworkCore.SQLServer, .Design, and .Tools NuGet packages. I have an existing database. Let's assume this database was created and maintained by my organization's database administrator. This database is already…

Contents