ValidationResult Constructors

Definition

Initializes a new instance of the ValidationResult class.

Overloads

ValidationResult(ValidationResult)

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

ValidationResult(String)

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

ValidationResult(String, IEnumerable<String>)

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

ValidationResult(ValidationResult)

Source:
ValidationResult.cs
Source:
ValidationResult.cs
Source:
ValidationResult.cs

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

protected ValidationResult (System.ComponentModel.DataAnnotations.ValidationResult validationResult);

Parameters

validationResult
ValidationResult

The validation result object.

Exceptions

validationResult is null.

Remarks

The method creates a copy of an exiting ValidationResult object.

Applies to

.NET 9 ja muud versioonid
Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

ValidationResult(String)

Source:
ValidationResult.cs
Source:
ValidationResult.cs
Source:
ValidationResult.cs

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

public ValidationResult (string errorMessage);
public ValidationResult (string? errorMessage);

Parameters

errorMessage
String

The error message.

Applies to

.NET 9 ja muud versioonid
Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

ValidationResult(String, IEnumerable<String>)

Source:
ValidationResult.cs
Source:
ValidationResult.cs
Source:
ValidationResult.cs

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

public ValidationResult (string errorMessage, System.Collections.Generic.IEnumerable<string> memberNames);
public ValidationResult (string? errorMessage, System.Collections.Generic.IEnumerable<string>? memberNames);

Parameters

errorMessage
String

The error message.

memberNames
IEnumerable<String>

The list of member names that have validation errors.

Applies to

.NET 9 ja muud versioonid
Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0