Edit

Share via


ValidationError Constructors

Definition

Creates a new instance of a ValidationError class.

Overloads

ValidationError(String)

Creates a new instance of the ValidationError class using the specified error message.

ValidationError(String, Boolean)

Creates a new instance of the ValidationError class using the specified error message and warning indication.

ValidationError(String, Boolean, String)

Creates a new instance of the ValidationError class using the specified error message, warning indicator, and name of the property that caused the error.

ValidationError(String, Boolean, String, Object)

Creates a new instance of the ValidationError class using the specified error message, warning indicator, name of the property and the source detail that caused the error.

ValidationError(String)

Creates a new instance of the ValidationError class using the specified error message.

public ValidationError(string message);

Parameters

message
String

The information about the error.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

ValidationError(String, Boolean)

Creates a new instance of the ValidationError class using the specified error message and warning indication.

public ValidationError(string message, bool isWarning);

Parameters

message
String

The error message.

isWarning
Boolean

true if the error is a warning; otherwise, false.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

ValidationError(String, Boolean, String)

Creates a new instance of the ValidationError class using the specified error message, warning indicator, and name of the property that caused the error.

public ValidationError(string message, bool isWarning, string propertyName);

Parameters

message
String

The error message.

isWarning
Boolean

An indicator whether the error is a warning.

propertyName
String

The alphanumeric name of the property that generated the error.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

ValidationError(String, Boolean, String, Object)

Creates a new instance of the ValidationError class using the specified error message, warning indicator, name of the property and the source detail that caused the error.

public ValidationError(string message, bool isWarning, string propertyName, object sourceDetail);

Parameters

message
String

The error message.

isWarning
Boolean

An indicator whether the error is a warning.

propertyName
String

The alphanumeric name of the property that generated the error.

sourceDetail
Object

The detail about the source of the error.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 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