// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddMediatR(cfg => cfg.AsSingleton(), typeof(Startup).Assembly, typeof(EmailSenderService).Assembly); services.AddHangfire( configuration => configuration.SetDataCompatibilityLevel(CompatibilityLevel.Version_170) .UseSimpleAssemblyNameTypeSerializer() .UseRecommendedSerializerSettings() // .UseMemoryStorage(new MemoryStorageOptions { JobExpirationCheckInterval = TimeSpan.FromMinutes(10) }) // .UseSQLiteStorage("Filename=psm.db", sqliteOptions) .UseSQLiteStorage( Configuration.GetConnectionString("HangfireSqliteConnection"), new SQLiteStorageOptions())); services.AddSingleton <IKeyValueProvider, AzureKeyVaultProvider>(); services.AddSingleton( (serviceProvider) => { IKeyValueProvider keyVault = serviceProvider.GetService <IKeyValueProvider>(); return(new EmailSenderService(keyVault)); }); }
/// <summary> /// Adds a new entry in this collection with the key value of the provider, and the provider as the value. /// </summary> /// <param name="item"></param> /// <remarks>When retrieveing the value the provider will be invoked to return the actual required value</remarks> public void Add(IKeyValueProvider item) { string name = item.ID; this[name] = item; }
public EmailSenderService(IKeyValueProvider keyValue) { _keyValue = keyValue; }
public CaptchaController(IKeyValueProvider keyValueProvider, ICaptchaProvider captchaProvider) { _KeyValueProvider = keyValueProvider; CaptchaProvider = captchaProvider; }
public TypedKeyValueService(IOptions <KeyValueOptions> options, IKeyValueProvider keyValueProvider) : base(options, GetTypeCategoryName(options, typeof(T)), keyValueProvider) { }
public KeyValueService(IOptions <KeyValueOptions> options, string categoryName, IKeyValueProvider keyValueProvider) { this.categoryName = CombinCategoryName(options, categoryName); this.keyValueProvider = keyValueProvider; }
public KeyValueFactory(IOptions <KeyValueOptions> options, IKeyValueProvider keyValueProvider) { this.keyValueOptions = options; this.keyValueProvider = keyValueProvider; }
public XmlRepositoryProvider(IKeyValueProvider sqlKeyValue, string name = "XmlRepo") { Name = name; SqlKeyValue = sqlKeyValue; }