Skip to content

JohnCampionJr/Finbuckle.MultiTenant.MongoFramework

Repository files navigation

Actions Status Codacy Badge codecov

Finbuckle.MultiTenant.MongoFramework

This is an integration of MongoFramework and Finbuckle.MultiTenant.

Features

Working samples are provided for all of the following.

MongoTenantStore

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.

Isolated Data Per Tenant

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.

MongoDb optimized TenantInfo

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.

Samples

  • 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

About

MongoFramework store and per tenant data isolation for Finbucle.MultiTenant

Resources

License

Stars

Watchers

Forks