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
IConfigurationBuilderThe IConfigurationBuilder to add to.
configureSource
Action<TSource>Configures the source secrets.
Returns
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
IConfigurationThe 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
IConfigurationThe IConfiguration to enumerate.
makePathsRelative
boolIf 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
GetConnectionString(IConfiguration, string)
Shorthand for GetSection("ConnectionStrings")[name].
public static string GetConnectionString(this IConfiguration configuration, string name)
Parameters
configuration
IConfigurationThe configuration.
name
stringThe connection string key.