Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Provider Logo

Using Entity Framework Core with Legacy Databases

via LinkedIn Learning


Learn how to improve and reduce database-access code for legacy databases by using Entity Framework Core.

Not every development project starts from scratch. Often, you're rewriting applications to take advantage of different data sources, or to make connections to legacy data in more efficient ways. Entity Framework (EF) Core plays extremely well with existing databases, and it can generate some of the data-access code for you automatically. Using the practical techniques shown in this course, you can use EF Core with existing relational databases, and modify the generated code as necessary. Richard Goforth shows how to connect to a database, scaffold a model from it, and begin improving on that model. He uses shadow properties, concurrency tokens, and other techniques to best map a database to an application. No matter how untidy your tables and fields, EF Core will help you write clean, cross-platform code that is easy to maintain in the long run.


  • Welcome to Entity Framework Core
  • What you need to know
  • Platforms available to Entity Framework Core
  • Why Entity Framework Core for an existing database?
  • When Entity Framework Core might not be a good choice
  • Using the exercise files
1. Get Started with Entity Framework Core (on Your Legacy Database)
  • Setting up your project
  • Connecting to the database
  • Scaffolding an initial model and context
  • Choose your approach
  • Understanding the generated context
  • Migrations against an existing database
2. Improve the Model
  • Why change the generated model
  • Changing names
  • Using shadow properties
  • Generated properties and default values
  • Using backing fields
  • Adding and altering indexes
  • Adding concurrency tokens and timestamps
3. Model Complex Relationships
  • Creating an inheritance relationship
  • Navigation properties
  • Alternate keys and multicolumn keys
  • Accessing computed columns
  • Challenge: Product recall
  • Solution: Product recall
4. Work with Non-Microsoft Databases
  • Other database platforms
  • Create a SQLite database
  • Populate a SQLite database
  • PostgreSQL on a Mac
  • Other options
  • Next Steps

Taught by

Richard Goforth

Related Courses


0.0 rating, based on 0 reviews

Start your review of Using Entity Framework Core with Legacy Databases

Never stop learning Never Stop Learning!

Get personalized course recommendations, track subjects and courses with reminders, and more.

Sign up for free