Skip to content

i take it MyDbContext : EFCoreStoreDbContext<TenantInfo>, IMultiTenantDbContext is a mistake? #629

Discussion options

You must be logged in to vote

Hi, usually the tenant store itself is not "multitenant" although in some rare situations that might be feasible. Rather than an infinite loop what would usually happen is that the store raises an exception because it was unable to inject the the ITenantInfo.

If this is something you want to try I recommend separating out the tenant resolution for the store itself. you can instantiate TenantResolver and loop through its IMultiTenantStrategies to find a likely identifier then use to instantiate the store to be used in the ASP.NET Middleware. This logic would need to be in the store constructor or a factory method used for injecting the store.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vigouredelaruse
Comment options

Answer selected by vigouredelaruse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants