EFCoreStoreDbContext vs MultiTenantIdentityDbContext #664
Replies: 2 comments 3 replies
-
Ahhhh I think I have it now, correct me if I'm wrong. The MultiTenantIdentityDbContext can be thought of an an extension to IdentityDbContext or should I say replaces it!?! I now have a EFCoreStoreDbContext derived context to handle "Tenant context" Just a note for others, as I am implementing a custom ApplicationUser rather than IdentityUser I needed to add the following to protected override void OnModelCreating(ModelBuilder modelBuilder) |
Beta Was this translation helpful? Give feedback.
-
Sounds like you got it right. EFCoreStore is just a place where you tenants are listed out. Doesn't have any per-tenant data at all. Just a normal database used during tenant resolution (and you can use other store types if you prefer, don't have to use EFCoreStore).
|
Beta Was this translation helpful? Give feedback.
-
Hi, sorry if I am missing the point again!!!
If I want to persist TenatInfo and Identity data in a SQL Db via EF Core, reading the docs it is not clear to me why I should derive the DbContext from EFCoreStoreDbContext. It seems (not tested yet) that deriving from MultiTenantIdentityDbContext will provide all the data isolation I need.
Is there a difference between the two classes?
Thanks Nick
Beta Was this translation helpful? Give feedback.
All reactions