Struct OptionItem<TKey>
- Namespace
- ItTiger.TigerCli.Primitives
- Assembly
- ItTiger.TigerCli.dll
A provider choice with a canonical key and a user-facing label.
public readonly record struct OptionItem<TKey> : IEquatable<OptionItem<TKey>>
Type Parameters
TKey- The type of the canonical value bound when the choice is selected.
- Implements
-
IEquatable<OptionItem<TKey>>
- Inherited Members
Remarks
Providers return these items for provider-backed prompts and provider validation. The label is
displayed in select prompts; the key is the value bound back to the settings property when selected
or when a supplied value matches the choice. Keys must be non-null and unique within one provider
result.
Constructors
OptionItem(TKey, string)
A provider choice with a canonical key and a user-facing label.
public OptionItem(TKey Key, string Label)
Parameters
KeyTKey- The canonical value for the choice.
Labelstring- The display label shown to the user.
Remarks
Providers return these items for provider-backed prompts and provider validation. The label is
displayed in select prompts; the key is the value bound back to the settings property when selected
or when a supplied value matches the choice. Keys must be non-null and unique within one provider
result.
Properties
Key
The canonical value for the choice.
public TKey Key { get; init; }
Property Value
- TKey
Label
The display label shown to the user.
public string Label { get; init; }