This is an integration of MongoFramework and Finbuckle.MultiTenant.
Working samples are provided for all of the following.
Uses MongoFramework to provide a store for Finbuckle.MultiTenant.
Any MongoDbContext can be provided via injection to this store.
It does not require a specific interface or base class.
Provides isolated data, either with shared data or database per tenant or both.
The MongoTenantStore allows for an option DefaultConnectionString that is added to any tenants that do not have their own ConnectionString
The MongoPerTenantConnection then accepts the ITenantInfo and uses its ConnectionString to connect to MongoDb.
The MongoPerDbContext passes along the Id from ITenantInfo to be used with a MongoTenantContext That context (in MongoFramework) provides isolated data access based on the tenant Id.
TenantInfo optimized for MongoDb (Index on identifier, "Tenants" table name)
This is completely optional, but provided as a convenience. You can use any ITenantInfo you'd like.
- DataIsolationSample - how to use the data isolation features
- MongoTenantStoreSample - how to implement MongoTenantStore
- CombinedSample - how to use both the MongoTenantStore and data isolation in one project