Skip to content

ValidationRules.ValidateObjectAsync method

Validates the properties of an object like ValidateObject, awaiting the rules that can be checked asynchronously, see IAsyncValidationRule.

public static ValueTask<ObjectValidationFailure?> ValidateObjectAsync(object instance, 
    ObjectValidationOptions? options = null, CancellationToken cancellationToken = default)
parameter description
instance The object.
options How it is validated.
cancellationToken The cancellation token.

Return Value

The first property whose value is not valid, or null when they all are.

See Also