Table of Contents

Class TigerCliProviderConfiguration

Namespace
ItTiger.TigerCli.Commands
Assembly
ItTiger.TigerCli.dll
Registers app-level named dynamic value providers, configured through TigerCliAppBuilder.ConfigureProviders(...). A provider is referenced by key from Provider / Provider (or matched implicitly by property name for options) and supplies the choices used by provider-backed prompting and by validation of supplied values. String providers use each string as both value and label; named providers return key/label pairs. On every overload the optional dependsOn names values that should be resolved first, and the trailing configure callback receives a TigerCliProviderOptions for provider-specific framework text (loading message, empty message) — omit it for generic localized defaults.
public sealed class TigerCliProviderConfiguration
Inheritance
TigerCliProviderConfiguration
Inherited Members

Methods

Add(string, Func<TigerCliProviderContext, IReadOnlyList<string>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers a sync app-level string provider; each returned string is used as both value and label. Prefer the async overloads for slow or I/O-backed providers.
public void Add(string key, Func<TigerCliProviderContext, IReadOnlyList<string>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, IReadOnlyList<string>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.

Add(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level string provider; each returned string is used as both value and label. Equivalent to AddAsync(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?), which is the preferred spelling for new code.
public void Add(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.

AddAsync(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level string provider. Prefer this over the sync Add(string, Func<TigerCliProviderContext, IReadOnlyList<string>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?) for slow or I/O-backed providers; observe CancellationToken to make the work cooperatively cancellable, and use configure to customize the loading message.
public void AddAsync(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

AddAsync<TValue>(string, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level named provider. Prefer this over the sync overload for slow or I/O-backed providers; observe CancellationToken to make the work cooperatively cancellable, and use configure to customize the loading message.
public void AddAsync<TValue>(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TValue

AddAsync<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level named provider that can read partially bound settings. Prefer this over the sync overload for slow or I/O-backed providers; observe CancellationToken to make the work cooperatively cancellable, and use configure to customize the loading message.
public void AddAsync<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings

Parameters

key string
provider Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TSettings
TValue

Add<TValue>(string, Func<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers a sync app-level named provider returning key/label pairs (OptionItem<TKey>). Prefer the async overloads for slow or I/O-backed providers.
public void Add<TValue>(string key, Func<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TValue

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.

Add<TValue>(string, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level named provider returning key/label pairs (OptionItem<TKey>). The key is the bound value; the label is display text. Equivalent to the AddAsync spelling, which is preferred for new code.
public void Add<TValue>(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)

Parameters

key string
provider Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TValue

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.

Add<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers a sync app-level named provider that additionally receives the partially bound settings instance. Prefer the async overloads for slow or I/O-backed providers.
public void Add<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings

Parameters

key string
provider Func<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TSettings
TValue

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.

Add<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)

Registers an async app-level named provider that additionally receives the partially bound settings instance, letting the choices depend on values supplied earlier in the run. Equivalent to the AddAsync spelling, which is preferred for new code.
public void Add<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings

Parameters

key string
provider Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>
dependsOn IEnumerable<string>
configure Action<TigerCliProviderOptions>

Type Parameters

TSettings
TValue

Exceptions

ArgumentException
key is null, empty, or whitespace.
ArgumentNullException
provider is null.