Table of Contents

Class ConfigurationExtensions

Namespace
Acuit.Pinpoint.Configuration
Assembly
Acuit.Pinpoint.Configuration.dll

Extension methods for configuration classes./>.

public static class ConfigurationExtensions
Inheritance
ConfigurationExtensions
Inherited Members

Methods

Add<TSource>(IConfigurationBuilder, Action<TSource>)

Adds a new configuration source.

public static IConfigurationBuilder Add<TSource>(this IConfigurationBuilder builder, Action<TSource> configureSource) where TSource : IConfigurationSource, new()

Parameters

builder IConfigurationBuilder

The IConfigurationBuilder to add to.

configureSource Action<TSource>

Configures the source secrets.

Returns

IConfigurationBuilder

The IConfigurationBuilder.

Type Parameters

TSource

AsEnumerable(IConfiguration)

Get the enumeration of key value pairs within the IConfiguration

public static IEnumerable<KeyValuePair<string, string>> AsEnumerable(this IConfiguration configuration)

Parameters

configuration IConfiguration

The IConfiguration to enumerate.

Returns

IEnumerable<KeyValuePair<string, string>>

An enumeration of key value pairs.

AsEnumerable(IConfiguration, bool)

Get the enumeration of key value pairs within the IConfiguration

public static IEnumerable<KeyValuePair<string, string>> AsEnumerable(this IConfiguration configuration, bool makePathsRelative)

Parameters

configuration IConfiguration

The IConfiguration to enumerate.

makePathsRelative bool

If true, the child keys returned will have the current configuration's Path trimmed from the front.

Returns

IEnumerable<KeyValuePair<string, string>>

An enumeration of key value pairs.

Exists(IConfigurationSection)

Determines whether the section has a Value or has children

public static bool Exists(this IConfigurationSection section)

Parameters

section IConfigurationSection

Returns

bool

GetConnectionString(IConfiguration, string)

Shorthand for GetSection("ConnectionStrings")[name].

public static string GetConnectionString(this IConfiguration configuration, string name)

Parameters

configuration IConfiguration

The configuration.

name string

The connection string key.

Returns

string