Exemplo n.º 1
0
        protected override void InstallHostingSpecificClasses(IServiceCollection services)
        {
            services.AddSingleton(CloudOdsAzureActiveDirectoryClientInfo.GetActiveDirectoryClientInfoForUser());

            services.AddTransient <IGetAzureCloudOdsHostedComponentsQuery, GetAzureCloudOdsHostedComponentsQuery>();
            services.AddTransient <IGetCloudOdsApiWebsiteSettingsQuery, GetAzureCloudOdsApiWebsiteSettingsQuery>();
            services.AddTransient <IAzureSqlSecurityConfigurator, AzureSqlSecurityConfigurator>();
            services.AddTransient <GetAzureCloudOdsHostedInstanceQuery>();
            services.AddTransient <ICompleteOdsPostUpdateSetupCommand, CompleteAzureOdsPostUpdateSetupCommand>();
            services.AddTransient <IRestartAppServicesCommand, RestartAzureAppServicesCommand>();
            services.AddTransient <IUpdateCloudOdsApiWebsiteSettingsCommand, UpdateAzureCloudOdsApiWebsiteSettingsCommand>();
            services.AddTransient <IGetCloudOdsInstanceQuery, GetAzureCloudOdsInstanceQuery>();
            services.AddTransient <ICloudOdsDatabaseSqlServerSecurityConfiguration, AzureCloudOdsDatabaseSqlServerSecurityConfiguration>();
            services.AddTransient <IFirstTimeSetupService, AzureFirstTimeSetupService>();
            services.AddTransient <ICloudOdsDatabaseNameProvider, AzureCloudOdsDatabaseNameProvider>();
            services.AddTransient <ITabDisplayService, AzureTabDisplayService>();
            services.AddTransient <ICompleteOdsFirstTimeSetupCommand, CompleteAzureFirstTimeSetupCommand>();
        }
        private void InstallAzureSpecificServices(IWindsorContainer container)
        {
            container.Register(Component.For <AzureActiveDirectoryClientInfo>()
                               .Instance(CloudOdsAzureActiveDirectoryClientInfo.GetActiveDirectoryClientInfoForUser())
                               .LifestyleSingleton());

            container.Register(Component.For <IGetCloudOdsHostedComponentsQuery, IGetAzureCloudOdsHostedComponentsQuery, GetAzureCloudOdsHostedComponentsQuery>()
                               .ImplementedBy <GetAzureCloudOdsHostedComponentsQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetAzureCloudOdsWebsitePerformanceLevelQuery, GetAzureCloudOdsWebsitePerformanceLevelQuery>()
                               .ImplementedBy <GetAzureCloudOdsWebsitePerformanceLevelQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetCloudOdsApiWebsiteSettingsQuery, GetAzureCloudOdsApiWebsiteSettingsQuery>()
                               .ImplementedBy <GetAzureCloudOdsApiWebsiteSettingsQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <AzureDatabaseManagementService>()
                               .ImplementedBy <AzureDatabaseManagementService>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsDatabaseSecurityConfigurator, SqlServerCloudOdsDatabaseSecurityConfigurator>()
                               .ImplementedBy <SqlServerCloudOdsDatabaseSecurityConfigurator>()
                               .LifestyleTransient());

            container.Register(Component.For <AzureDatabaseLifecycleManagementService>()
                               .ImplementedBy <AzureDatabaseLifecycleManagementService>()
                               .LifestyleTransient());

            container.Register(Component.For <GetAzureCloudOdsHostedInstanceQuery>()
                               .ImplementedBy <GetAzureCloudOdsHostedInstanceQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <ICompleteOdsPostUpdateSetupCommand>()
                               .ImplementedBy <CompleteAzureOdsPostUpdateSetupCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <IRestartAppServicesCommand>()
                               .ImplementedBy <RestartAzureAppServicesCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <IUpdateCloudOdsApiWebsiteSettingsCommand>()
                               .ImplementedBy <UpdateAzureCloudOdsApiWebsiteSettingsCommand>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetLatestPublishedOdsVersionQuery>()
                               .ImplementedBy <GetLatestPublishedOdsVersionQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetProductionApiProvisioningWarningsQuery>()
                               .ImplementedBy <GetAzureProductionApiProvisioningWarningsQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsProductionLifecycleManagementService>()
                               .ImplementedBy <AzureProductionLifecycleManagementService>()
                               .LifestyleTransient());

            container.Register(Component.For <IGetCloudOdsInstanceQuery>()
                               .ImplementedBy <GetAzureCloudOdsInstanceQuery>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsDatabaseSqlServerSecurityConfiguration>()
                               .ImplementedBy <AzureCloudOdsDatabaseSqlServerSecurityConfiguration>()
                               .LifestyleTransient());

            container.Register(Component.For <IFirstTimeSetupService>()
                               .ImplementedBy <AzureFirstTimeSetupService>()
                               .LifestyleTransient());

            container.Register(Component.For <ICloudOdsDatabaseNameProvider>()
                               .ImplementedBy <AzureCloudOdsDatabaseNameProvider>()
                               .LifestyleTransient());

            container.Register(Component.For <IStringEncryptorService>()
                               .ImplementedBy <StringEncryptorService>()
                               .LifestyleTransient());

            container.Register(Component.For <ITabDisplayService>()
                               .ImplementedBy <AzureTabDisplayService>()
                               .LifestyleTransient());

            container.Register(Component.For <IHomeScreenDisplayService>()
                               .ImplementedBy <AzureHomeScreenDisplayService>()
                               .LifestyleTransient());

            container.Register(
                Component.For <ICompleteOdsFirstTimeSetupCommand>()
                .ImplementedBy <CompleteOdsFirstTimeSetupCommand>()
                .LifestyleTransient());
        }