ConfigurationExtensions Class

Definition

Static class containing extension methods for IConfiguration to get ClientSettings.

public static class ConfigurationExtensions
type ConfigurationExtensions = class
Public Module ConfigurationExtensions
Inheritance
ConfigurationExtensions

Methods

Name Description
AddClient<TClient,TSettings>(IHostApplicationBuilder, String, Action<TSettings>)

Adds a singleton client of the specified type to the IHostApplicationBuilder's service collection.

AddClient<TClient,TSettings>(IHostApplicationBuilder, String)

Adds a singleton client of the specified type to the IHostApplicationBuilder's service collection.

AddCredentialResolver<T>(IHostApplicationBuilder)

Registers T as a CredentialResolver service on the host's service collection.

AddCredentialResolver<T>(IServiceCollection)

Registers T as a CredentialResolver service. Idempotent by implementation type — calling twice with the same T registers a single instance.

AddKeyedClient<TClient,TSettings>(IHostApplicationBuilder, String, String, Action<TSettings>)

Adds a keyed singleton client of the specified type to the IHostApplicationBuilder's service collection.

AddKeyedClient<TClient,TSettings>(IHostApplicationBuilder, String, String)

Adds a keyed singleton client of the specified type to the IHostApplicationBuilder's service collection.

GetClientSettings<T>(IConfiguration, String, CredentialResolver[])

Creates an instance of T and sets its properties from the specified IConfiguration, additionally resolving CredentialProvider from the supplied CredentialResolver chain.

GetClientSettings<T>(IConfiguration, String, IEnumerable<CredentialResolver>, Action<IConfigurationSection>)

Creates an instance of T and sets its properties from the specified IConfiguration, additionally resolving CredentialProvider from the supplied CredentialResolver chain after applying configureOverrides to the credential section.

GetClientSettings<T>(IConfiguration, String)

Creates an instance of T and sets its properties from the specified IConfiguration.

GetCredential(IConfiguration, String, CredentialResolver[])

Walks the supplied CredentialResolver chain in order (first match wins) against the named credential section and returns the produced AuthenticationTokenProvider, or null if no resolver claimed the section. The supplied sectionName is treated as the credential section itself. Never throws.

GetCredential(IConfiguration, String, IEnumerable<CredentialResolver>, Action<IConfigurationSection>)

Applies configureOverrides to a writable overlay of the named credential section, then walks the supplied CredentialResolver chain. The supplied sectionName is treated as the credential section itself. Never throws.

GetCredential(IConfiguration, String)

Resolves an AuthenticationTokenProvider for the named credential section. The supplied sectionName is treated as the credential section itself (not a parent client section). This overload always returns null because no CredentialResolver chain has been supplied — use the overload that accepts resolvers to participate in resolution. Never throws.

Applies to