Share via


PromptValidator<T> Delegate

Definition

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.

Applies to