Exemplo n.º 1
0
        public static void SetTenant(this HttpContext context, AppTenant tenant)
        {
            //Ensure.Argument.NotNull(context, nameof(context));
            //Ensure.Argument.NotNull(tenantContext, nameof(tenantContext));

            context.Items[TenantKey] = tenant;
        }
Exemplo n.º 2
0
        public async Task <AppTenant> ResolveAsync(HttpContext context)
        {
            AppTenant tenant = null;

            foreach (var resolver in _options.Value.Resolvers)
            {
                tenant = await resolver.ResolveAsync(context);

                if (tenant != null)
                {
                    break;
                }
            }
            return(tenant);
        }