AppSettingsExtensionsAddAppSettings Method

Adds an IConfigurationSource for app settings to the given IConfigurationBuilder.

Definition

Namespace: Gemstone.Configuration.AppSettings
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.165 -- Release Build+e14d337b173ad33e50be6747ce5b02f477f99484
public static IConfigurationBuilder AddAppSettings(
	this IConfigurationBuilder configurationBuilder,
	Action<IAppSettingsBuilder> buildAction
)

Parameters

configurationBuilder  IConfigurationBuilder
The configuration builder.
buildAction  ActionIAppSettingsBuilder
The action to build app settings.

Return Value

IConfigurationBuilder
The configuration builder.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IConfigurationBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

This extension provides a simple way to add default values as well as descriptions for app settings directly into an application. The source for these is a simple in-memory collection, and additional key/value pairs are added so that the initial value and descriptions of these settings can still be retrieved even if the settings themselves get overridden by another configuration source.

See Also