Table of Contents

ConfigurationKeyMapping Enum

Definition

Namespace
Bodu.Text.Configuration
Assembly
Bodu.Text.Configuration.dll
Package
Bodu.Text.Configuration 1.3.0
Source
ConfigurationKeyMapping.cs

Selects how raw configuration keys are mapped to the logical keys used by the resolved view: colon-delimited, as Microsoft.Extensions.Configuration expects, or, under Identity, kept as written.

public enum ConfigurationKeyMapping
Extension Methods

Fields

DotToColon = 0

Dotted file keys map to colon-delimited logical keys: logging.level.default ⇒ logging:level:default. This is the default Bodu mapping and the primary v1 mode.

Colon = 1

Intended for file keys that already use colon segment separators (logging:level:default), the MEC logical key shape. It currently behaves exactly as DotToColon: a key is split on every configured separator, dots included, and its segments are joined with colons.

Identity = 2

File keys are not split into segments, so their dots and colons stay as written, and the logical configuration key equals the raw key with the whitespace at its ends trimmed, lowercased when LowercaseKeys is set. Use this when integrating with sources that use a custom segment convention; the EditorConfigCompatible presets use it.

Remarks

A future release may add a MixedDotAndColon mode that permits a single document to combine both separator forms; v1 deliberately keeps the surface area small.

// "logging.level" under each mapping:
//   DotToColon -> "logging:level" (dots and colons both address it)
//   Colon      -> "logging:level" (currently the same as DotToColon)
//   Identity   -> "logging.level" (verbatim)
var keyOptions = new ConfigurationKeyOptions { Mapping = ConfigurationKeyMapping.DotToColon };

Applies to

ProductVersions
.NET8, 10