Exemplo n.º 1
0
        public string GetConnectionString()
        {
            var defaultConnectionStringName = "DefaultConnection";
            var actualConnectionStringName  = defaultConnectionStringName;
            var currentTenant = tenantResolver.GetCurrentTenant();

            if (!string.IsNullOrEmpty(currentTenant))
            {
                actualConnectionStringName = currentTenant;
            }

            return(configuration.GetConnectionString(actualConnectionStringName)
                   ?? configuration.GetConnectionString(defaultConnectionStringName));
        }
Exemplo n.º 2
0
        public bool Evaluate(FeatureFilterEvaluationContext context)
        {
            var tenantSetting = context.Parameters.Get <TenantSettings>() ?? new TenantSettings();

            return(tenantSetting.GetTenants().Contains(_tenantResolver.GetCurrentTenant() ?? "NULL"));
        }