Closed jkonecki closed 7 years ago
That's because ids are/should be unique. If you're doing multi-tenancy by separate DBs, then you don't need the built-in multi-tenancy feature of MR, IMO.
So you're suggesting one has a separate instance or Service and Repository for each tenant? That will require a straightforward change to dependency injection configuration.
That will require a straightforward change to dependency injection configuration.
Yea, this is a common way to achieve multi-tenancy. Just have the DI system dynamically inject the right store/repository to the right tenant DB.
That information could be useful on the multitenancy wiki page.
There is no overload for
IUserAccountRepository.GetByID()
that takesstring tenant
as the first argument. That causes the problem is cases where multitenancy is implemented using separate databases for each tenant as the cross-database query is needed to find the account. Also, this enforces unique ids across all the tenants (that's a lesser issue).Because of the above there is a number of methods in
UserAccountService
that are missing multitenant overloads as well, eg.SetPassword
,ChangeEmailRequest
.That makes the multitenant feature hard to use in larger systems.