PromptValidator<T> Delegate
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The delegate definition for custom prompt validators. Implement this function to add custom validation to a prompt.
public delegate System.Threading.Tasks.Task<bool> PromptValidator<T>(PromptValidatorContext<T> promptContext, CancellationToken cancellationToken);
type PromptValidator<'T> = delegate of PromptValidatorContext<'T> * CancellationToken -> Task<bool>
Public Delegate Function PromptValidator(Of T)(promptContext As PromptValidatorContext(Of T), cancellationToken As CancellationToken) As Task(Of Boolean)
Type Parameters
- T
The type the associated Prompt<T> prompts for.
Parameters
- promptContext
- PromptValidatorContext<T>
The prompt validation context.
- cancellationToken
- CancellationToken
The cancellation token.
Return Value
A Task of bool representing the asynchronous operation indicating validation success or failure.