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.147 -- Release Build+759c9d29b79c81f10905de8f58b653be932045f0
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