Beispiel #1
0
 public Startup(IConfiguration configuration)
 {
     ResultsAndCertificationConfiguration = ResultsAndCertificationConfigurationLoader.Load(
         configuration[Constants.EnvironmentNameConfigKey],
         configuration[Constants.ConfigurationStorageConnectionStringConfigKey],
         configuration[Constants.VersionConfigKey],
         configuration[Constants.ServiceNameConfigKey]);
 }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            ResultsAndCertificationConfiguration = ResultsAndCertificationConfigurationLoader.Load(
                Configuration[Constants.EnvironmentNameConfigKey],
                Configuration[Constants.ConfigurationStorageConnectionStringConfigKey],
                Configuration[Constants.VersionConfigKey],
                Configuration[Constants.ServiceNameConfigKey]);

            services.AddSingleton(ResultsAndCertificationConfiguration);
            services.AddTransient <IAsyncNotificationClient, NotificationClient>(provider => new NotificationClient(ResultsAndCertificationConfiguration.NotificationApiKey));
            services.AddTransient <INotificationService, NotificationService>();
            services.AddControllersWithViews();
        }