Secret weapon how to promote your YouTube channel
Get Free YouTube Subscribers, Views and Likes

Using Multiple EF Core DbContexts in a Single Application

Follow
Milan Jovanović

Get the source code for this video for FREE → https://thedotnetweekly.ck.page/mul...
☄ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt
Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ
Support me on Patreon to access the source code:   / milanjovanovic  

EF Core is the de facto ORM in the .NET community. To work with EF Core, you create a DbContext, representing your database. However, sometimes, you might need multiple EF Core DbContexts in a single application. In this video, I'll show you when you might need this and how to implement it.

Using Multiple EF Core DbContexts In a Single Application:
https://www.milanjovanovic.tech/blog/...

Join my weekly .NET newsletter:
https://www.milanjovanovic.tech

Read my Blog here:
https://www.milanjovanovic.tech/blog

Chapters
0:00 Adding two EF Core DbContext classes
3:57 Registering the DbContexts with DI
4:52 When do you want to use multiple DbContexts?
6:31 Moving DbContexts into separate schemas and creating migrations
10:10 Fixing the EF migration history table schema
11:38 How to use multiple DbContexts in Minimal APIs
15:35 What you can and CAN'T do with multiple DbContexts

posted by laydlayout5kn