<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-preview.5.20278.1" />

System.ComponentModel.DataAnnotations.CustomValidationAttribute

Specifies a custom validation method that is used to validate a property or class instance.
public string Method { get; }

Gets the validation method.

public Type ValidatorType { get; }

Gets the type that performs custom validation.

public CustomValidationAttribute(Type validatorType, string method)

Initializes a new instance of the CustomValidationAttribute class.