public static IServiceCollection AddAzureKeyVaultPrivateCertificateStore(this IServiceCollection services, Action <IServiceProvider, AzureKeyVaultSecretStoreOptionsBuilder> setupAction) { ArgCheck.NotNull(nameof(services), services); ArgCheck.NotNull(nameof(setupAction), setupAction); return(services.AddScoped <IPrivateCertificateStore>(serviceProvider => { var builder = new AzureKeyVaultSecretStoreOptionsBuilder(); setupAction(serviceProvider, builder); var options = builder.Build(); return new AzureKeyVaultSecretStore(options); })); }
public static IServiceCollection AddAzureKeyVaultSecretStore(this IServiceCollection services, Action <AzureKeyVaultSecretStoreOptionsBuilder> setupAction) { ArgCheck.NotNull(nameof(services), services); ArgCheck.NotNull(nameof(setupAction), setupAction); return(services.AddSingleton <ISecretReadOnlyStore>(serviceProvider => { var builder = new AzureKeyVaultSecretStoreOptionsBuilder(); setupAction(builder); var options = builder.Build(); return new AzureKeyVaultSecretStore(options); })); }