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

System.ComponentModel.DataAnnotations.ValidationResult

public class ValidationResult
Represents a container for the results of a validation request.
public static readonly ValidationResult Success

Represents the success of the validation (true if validation was successful; otherwise, false).

public string ErrorMessage { get; set; }

Gets the error message for the validation.

public IEnumerable<string> MemberNames { get; }

Gets the collection of member names that indicate which fields have validation errors.

public ValidationResult(string errorMessage)

Initializes a new instance of the ValidationResult class by using an error message.

public ValidationResult(string errorMessage, IEnumerable<string> memberNames)

Initializes a new instance of the ValidationResult class by using an error message and a list of members that have validation errors.

protected ValidationResult(ValidationResult validationResult)

Initializes a new instance of the ValidationResult class by using a ValidationResult object.