dazinator / Dotnettency

Mutlitenancy for dotnet applications
MIT License
111 stars 23 forks source link

EF Core - Multitenant IdentityDbContext #52

Closed dazinator closed 5 years ago

dazinator commented 5 years ago

At the moment, Dotnettency.EFCore provides a base DbContext class for you to derive from that provides multi-tenancy features - like global query filters based on current tenant id.

However AspNetCore Identity has an EF Provider that also provides an IdentityDbContext that you can derive from to gain asp.net core identity schema and features in your application.

In the case where you want to have a multi-tenant capable IdentityDbContext, the current solution is to derive from dotnettencies base dbcontext, and then manually add the methods required to make it compatible with asp.net core identity - because you can't also derive from IdentityDbContext. I want to make this easier..

I'll create a new otpional package - Dotnettency.EFCore.Identity that provides a MultitenantIdentityDbContext that appication dbcontexts can derive from that require multitenancy and identity.