I'm from Chile, I found your channel about 3 days ago and currently, I'm developing a .NET 7 web API for college and your videos were so helpful! Thank you so much.
It would be great if your next topic would be 2 DBContexts (Config, AppData) where the connection string for the second one(AppData) is stored in the first Database(Config). For a sharded multi-tenant example.
Hey there! Thank you for the video! Is it worth creating multiple DbContexts at all, and is it worth separating IdentityDbContext into a separate database? Does anyone actually do this in real projects?
Yes, it is worth because authentication and authorization are abstracted from business logic. But in this case scenario i would create a "UserTableInfo" in the characters dbcontext. Imagine if you want to get all the characters and their users, in this example you ll have to foreach loop all characters asking for theirs users. Multiple database queries. So whenever a user gets registered in one database you can add some userinfo in the characters userinfo table (other database), such as name,email, etc no sensitive info like passwords, etc so you can map faster with a simple Join
can we use this for switching of database? for example --user1 registered in DB1, user2 registered in DB2 --when they login they will be connecting automatically in their registered DB.. is it possible here?
is it possible to use multiple dbcontext in entity framework core that can share some tables such as Tenant, User, etc. in both context, but want to create table only from first context's migration, btw: I have one database, and I want to use different scheema. such as shared.tableName, sales.tableName, etc. actually I want to make moduler monolith application.
It would be better showing multi-tenancy application where users/customers have each their own dbcontext using same app. Think of something like quickbooks. It's not realistic to have diff dbs in this case videos games
I'm from Chile, I found your channel about 3 days ago and currently, I'm developing a .NET 7 web API for college and your videos were so helpful! Thank you so much.
Thanks a lot for your feedback, David! Really glad I could help! 😊
5:58 You can specify the output directories with a "-o" parameter. It doesn't even have to be in the Migrations folder.
Hey there! You're absolutely right. Thanks for pointing that out. 😊
Great tutorial. Most EF examples that I have seen have always been a 1:1 between app and database so this was nice to see in operation.
I was searching for this topic in the past few months. Thanks!
Welcome! Glad I could help! 😊
Cheers Patrick! Great job
Thank you so much, Darren! 😀
I was searching for a video on this topic. Thank you so much.
Glad I could help! 😊
@@PatrickGod Can you show us how we can manage JWT, like revoking and refreshing, in a web API app?
You can specify the folder where the migration goes. I find that handy to keep everything well organized
Thanks a lot for the video, God. Keep up
nice video... For anyone thinking about writes to multiple dbs - Saga
It would be great if your next topic would be 2 DBContexts (Config, AppData) where the connection string for the second one(AppData) is stored in the first Database(Config). For a sharded multi-tenant example.
Thanks a lot always for the video!. It would be great if you can make a topic about ef core with multithreading
Thanks God!!
You're welcome! 😊
Thanks that was really helpful.
Is this still the case in .net 8? meaning you have to do it manually?
Patrick good tutorial you can make the relation between the user table and character table in view model table rather the in the actual user model
Hey there! Thank you for the video!
Is it worth creating multiple DbContexts at all, and is it worth separating IdentityDbContext into a separate database? Does anyone actually do this in real projects?
Yes, it is worth because authentication and authorization are abstracted from business logic. But in this case scenario i would create a "UserTableInfo" in the characters dbcontext. Imagine if you want to get all the characters and their users, in this example you ll have to foreach loop all characters asking for theirs users. Multiple database queries.
So whenever a user gets registered in one database you can add some userinfo in the characters userinfo table (other database), such as name,email, etc no sensitive info like passwords, etc so you can map faster with a simple Join
What for we will need few contexts?
can we use this for switching of database? for example --user1 registered in DB1, user2 registered in DB2 --when they login they will be connecting automatically in their registered DB.. is it possible here?
is it possible to use multiple dbcontext in entity framework core that can share some tables such as Tenant, User, etc. in both context, but want to create table only from first context's migration,
btw: I have one database, and I want to use different scheema. such as shared.tableName, sales.tableName, etc. actually I want to make moduler monolith application.
How to add a Generic Repository pattern on top of this?
Migrations is possible now also with Visual Studio UI.
It would be better showing multi-tenancy application where users/customers have each their own dbcontext using same app. Think of something like quickbooks. It's not realistic to have diff dbs in this case videos games
😃😃😃😃😃