Validate<T>(TextPrompt<T>, Func<T, ValidationResult>) Method

Sets the validation criteria for the prompt.
public static TextPrompt<T> Validate<T>(this TextPrompt<T> obj, Func<T, ValidationResult> validator)
Namespace
Spectre.Console
Containing Type
TextPromptExtensions

Parameters

T
The prompt result type.

Parameters

TextPrompt<T> obj
The prompt.
Func<T, ValidationResult> validator
The validation criteria.

Returns