private async Task <IContainer> GetTenantContainerAsync(
            TenantContext <TTenant> tenantContext,
            Lazy <ITenantContainerBuilder <TTenant> > builder)
        {
            var tenantContainer = tenantContext.GetTenantContainer();

            if (tenantContainer == null)
            {
                tenantContainer = await builder.Value.BuildAsync(tenantContext.Tenant);

                tenantContext.SetTenantContainer(tenantContainer);
            }

            return(tenantContainer);
        }
示例#2
0
        private static async Task <IContainer> GetTenantContainerAsync(
            TenantContext tenantContext,
            Lazy <ITenantContainerBuilder> builder)
        {
            var tenantContainer = tenantContext.GetTenantContainer();

            if (tenantContainer != null)
            {
                return(tenantContainer);
            }

            tenantContainer = await builder.Value.BuildAsync(tenantContext.Tenant);

            tenantContext.SetTenantContainer(tenantContainer);

            return(tenantContainer);
        }