Using Multiple EF Core DbContexts in a Single Application

Using Multiple EF Core DbContexts in a Single Application

Milan Jovanović

54 года назад

38,450 Просмотров

Get the source code for this video for FREE → https://the-dotnet-weekly.ck.page/multiple-dbcontexts
☄️ 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: https://www.patreon.com/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/using-multiple-ef-core-dbcontext-in-single-application

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

Тэги:

#ef_core #ef_core_tutorial #ef_core_migrations #ef_core_code_first_approach #ef_core_relationship #ef_core_vs_dapper #ef_core_8 #ef_core_7 #ef_core_code_first #ef_core_6 #ef_core_dbcontext #ef_core_sql_server #ef_core_postgresql #ef_core_multiple_dbcontext #ef_core_multiple_dbcontexts #ef_core_dbcontexts #ef_core_dbcontext_migration #ef_core_multiple_db #ef_core_readonly_db #ef_core_modular_monolith #modular_monolith #multiple_dbs #read_replica #ef_core_read_replica
Ссылки и html тэги не поддерживаются


Комментарии: