Skip to content

MerifondNewMarkets/Dotnettency

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c# Dotnettency Mutlitenancy library for dotnet applications.

Branch Build Status Dotnettency Core Library Middleware Container StructureMap
Master Build status Dotnettency MiddlewarePipeline Container StructureMap
Develop Build status Dotnettency MiddlewarePipeline Container StructureMap

Heavily inspired by saaskit

Resources

Features

  • Tenant resolution
  • Per Tenant Middleware Pipeline
  • Per Tenant Containers
  • Per Tenant HostingEnvironment
  • Modules (Shared and Routed)

Tenant Injection

Once configured in startup.cs you can resolve the current tenant in any one of the following ways:

  • Inject TTenant directly (may block whilst resolving current tenant).
  • Inject Task<TTenant> - Allows you to await the current Tenant (so non blocking). Task<TTenant> is convenient.
  • Inject ITenantAccessor<TTenant>. This is similar to injecting Task<Tenant> in that it provides lazy access the current tenant in a non blocking way. For convenience it's now easier to just inject Task<Tenant> instead, unless you want a more descriptive API.

Tenant Shell Injection

The TenantShell stores additional context for a Tenant, such as it's Container and it's MiddlewarePipeline.

  • Inject ITenantShellAccessor<TTenant> in order to access context for the currnet tenant, which is primarily used by:
    • Extensions (such as Middleware, or Container) - which store things for the tenant in the ITenantShellAccessor<TTenant>'s concurrent property bag.
    • Tenant Admin screens - if you need to "Restart" a tenant, then the idea is, you can resolve the ITenantShellAccessor<TTenant> and then use extension methods (provided by the dotnettency extensions such as Middleware pipeline, or Container) to allow you to control the state of the running tenant - for example to trigger rebuild of the tenant's container, or pipeline on the next request.

Notes: For details on what Per Tenant Hosting Environment does see the README on the sample.

About

Mutlitenancy for dotnet applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 98.9%
  • Other 1.1%