public void AddServices(IServiceCollection services) { services.AddSingleton <IStorage, SqlServerStorage>(); services.AddSingleton <IBootstrapper, SqlServerBootstrapper>(); services.AddScoped <IStorageConnection, SqlServerStorageConnection>(); services.AddSingleton <IAdditionalProcessor, ExpirationManager>(); var sqlServerOptions = new SqlServerOptions(); _configure(sqlServerOptions); services.AddSingleton(sqlServerOptions); services.AddDbContext <JobsDbContext>(options => { options.UseSqlServer(sqlServerOptions.ConnectionString); }); }