<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0-rc.2.20475.5" />

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.