Get the source code for this video for FREE → https://the-dotnet-weekly.ck.page/read-write-db
☄️ 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 my favorite ORM, no competition. The central component is a DbContext. It's a logical representation of your database. However, having the same data model for writing and reading data isn't optimal. A rich domain model is used to encapsulate business logic. But, this structure is too rigid for writing application queries efficiently. So, you can introduce a separate read model to solve this. In this video, I'll show you when you might need this and how to implement it.
Check out my courses: https://bit.ly/3PupkOJ
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 When should you use this?
1:29 Creating the Write DbContext
4:11 Creating and configuring the Read DbContext
8:50 Using the Read DbContext for app queries