예제 #1
0
        private static void ConfigureCoreContextByDefault()
        {
            var cs = DbRegistry.GetConnectionString("core");

            if (cs == null)
            {
                throw new ConfigurationErrorsException("Can not configure CoreContext: connection string with name core not found.");
            }

            var tenantService = new CachedTenantService(new DbTenantService(cs));
            var userService   = new CachedUserService(new DbUserService(cs));
            var azService     = new CachedAzService(new DbAzService(cs));
            var quotaService  = new CachedQuotaService(new DbQuotaService(cs));
            var subService    = new CachedSubscriptionService(new DbSubscriptionService(cs));
            var tariffService = new TariffService(cs, quotaService, tenantService);

            Configuration        = new ClientConfiguration(tenantService);
            TenantManager        = new ClientTenantManager(tenantService, quotaService, tariffService);
            PaymentManager       = new ClientPaymentManager(Configuration, quotaService, tariffService);
            UserManager          = new ClientUserManager(userService);
            GroupManager         = new ClientUserManager(userService);
            Authentication       = new ClientAuthManager(userService);
            AuthorizationManager = new ClientAzManager(azService);
            SubscriptionManager  = new ClientSubscriptionManager(subService);
        }
예제 #2
0
 public HostedSolution(ConnectionStringSettings connectionString, string region)
 {
     tenantService = new DbTenantService(connectionString);
     userService = new DbUserService(connectionString);
     quotaService = new DbQuotaService(connectionString);
     tariffService = new TariffService(connectionString, quotaService, tenantService);
     clientTenantManager = new ClientTenantManager(tenantService, quotaService, tariffService);
     Region = region ?? string.Empty;
     DbId = connectionString.Name;
 }
예제 #3
0
 public HostedSolution(ConnectionStringSettings connectionString, string region)
 {
     tenantService       = new DbTenantService(connectionString);
     userService         = new DbUserService(connectionString);
     quotaService        = new DbQuotaService(connectionString);
     tariffService       = new TariffService(connectionString, quotaService, tenantService);
     clientTenantManager = new ClientTenantManager(tenantService, quotaService, tariffService);
     Region = region ?? string.Empty;
     DbId   = connectionString.Name;
 }
예제 #4
0
        private static void ConfigureCoreContextByDefault()
        {
            var cs = ConfigurationManager.ConnectionStrings["core"];
            if (cs == null)
            {
                throw new ConfigurationErrorsException("Can not configure CoreContext: connection string with name core not found.");
            }

            var tenantService = new CachedTenantService(new DbTenantService(cs));
            var userService = new CachedUserService(new DbUserService(cs));
            var azService = new CachedAzService(new DbAzService(cs));
            var quotaService = new CachedQuotaService(new DbQuotaService(cs));
            var subService = new CachedSubscriptionService(new DbSubscriptionService(cs));
            var tariffService = new TariffService(cs, quotaService, tenantService);

            Configuration = new ClientConfiguration(tenantService);
            TenantManager = new ClientTenantManager(tenantService, quotaService, tariffService);
            PaymentManager = new ClientPaymentManager(Configuration, quotaService, tariffService);
            UserManager = new ClientUserManager(userService);
            GroupManager = new ClientUserManager(userService);
            Authentication = new ClientAuthManager(userService);
            AuthorizationManager = new ClientAzManager(azService);
            SubscriptionManager = new ClientSubscriptionManager(subService);
        }
예제 #5
0
 public TenantQuota SaveTenantQuota(TenantQuota quota)
 {
     return(ClientTenantManager.SaveTenantQuota(quota));
 }
예제 #6
0
 public IEnumerable <TenantQuota> GetTenantQuotas()
 {
     return(ClientTenantManager.GetTenantQuotas());
 }
예제 #7
0
 public TenantQuota GetTenantQuota(int tenant)
 {
     return(ClientTenantManager.GetTenantQuota(tenant));
 }