Class DataAnnotationsValidator<T>
public class DataAnnotationsValidator<T> : IValidator<T> where T : notnull
Type Parameters
T
- Inheritance
-
objectDataAnnotationsValidator<T>
- Implements
-
IValidator<T>
Constructors
DataAnnotationsValidator(IServiceProvider)
public DataAnnotationsValidator(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Methods
Validate(T, CancellationToken)
Validates the specified object.
public Task<ValidationResult> Validate(T command, CancellationToken cancellationToken = default)
Parameters
commandTThe object to validate.
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<ValidationResult>
A task that represents the asynchronous validation operation. The task result contains the validation result.