ConfigurationKeyMapping Enum
Definition
- Namespace
- Bodu.Text.Configuration
- Assembly
- Bodu.Text.Configuration.dll
- Package
- Bodu.Text.Configuration 1.3.0
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 = 0Dotted 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 = 1Intended 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 = 2File 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
| Product | Versions |
|---|---|
| .NET | 8, 10 |