Beispiel #1
0
        public async Task Invoke(
            HttpContext httpContext,
            ITenancyDbContext dbContext,
            ITenantHolder tenantHolder,
            TenantCatchingList tenantCachingStrategies)
        {
            var tenantId = tenantCachingStrategies.GetTenantId(httpContext);

            if (tenantId.HasValue)
            {
                tenantHolder.Tenant = dbContext.Tenants.Find(tenantId);
            }

            await _next(httpContext);
        }
Beispiel #2
0
 public ValuesController(ITenantHolder tenantHolder)
 {
     _tenantHolder = tenantHolder;
 }