C# Class System.ComponentModel.DataAnnotations.ValidationException

Inheritance: Exception
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Méthodes publiques

Méthode Description
ValidationException ( ) : System.Runtime.Serialization

Default constructor.

The long form of this constructor is preferred because it gives better error reporting.

ValidationException ( System.ComponentModel.DataAnnotations.ValidationResult validationResult, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value ) : System.Runtime.Serialization

Constructor that accepts a structured ValidationResult describing the problem.

ValidationException ( string message ) : System.Runtime.Serialization

Constructor that accepts only a localized message

The long form of this constructor is preferred because it gives better error reporting.

ValidationException ( string message, Exception innerException ) : System.Runtime.Serialization

Constructor that accepts a localized message and an inner exception

The long form of this constructor is preferred because it gives better error reporting

ValidationException ( string errorMessage, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value ) : System.Runtime.Serialization

Constructor that accepts an error message, the failing attribute, and the invalid value.

Méthodes protégées

Méthode Description
ValidationException ( SerializationInfo info, StreamingContext context ) : System.Runtime.Serialization

Constructor that takes a SerializationInfo.

Method Details

ValidationException() public méthode

Default constructor.
The long form of this constructor is preferred because it gives better error reporting.
public ValidationException ( ) : System.Runtime.Serialization
Résultat System.Runtime.Serialization

ValidationException() protected méthode

Constructor that takes a SerializationInfo.
protected ValidationException ( SerializationInfo info, StreamingContext context ) : System.Runtime.Serialization
info System.Runtime.Serialization.SerializationInfo The SerializationInfo.
context System.Runtime.Serialization.StreamingContext The StreamingContext.
Résultat System.Runtime.Serialization

ValidationException() public méthode

Constructor that accepts a structured ValidationResult describing the problem.
public ValidationException ( System.ComponentModel.DataAnnotations.ValidationResult validationResult, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value ) : System.Runtime.Serialization
validationResult System.ComponentModel.DataAnnotations.ValidationResult The value describing the validation error
validatingAttribute System.ComponentModel.DataAnnotations.ValidationAttribute The attribute that triggered this exception
value object The value that caused the validating attribute to trigger the exception
Résultat System.Runtime.Serialization

ValidationException() public méthode

Constructor that accepts only a localized message
The long form of this constructor is preferred because it gives better error reporting.
public ValidationException ( string message ) : System.Runtime.Serialization
message string The localized message
Résultat System.Runtime.Serialization

ValidationException() public méthode

Constructor that accepts a localized message and an inner exception
The long form of this constructor is preferred because it gives better error reporting
public ValidationException ( string message, Exception innerException ) : System.Runtime.Serialization
message string The localized error message
innerException Exception inner exception
Résultat System.Runtime.Serialization

ValidationException() public méthode

Constructor that accepts an error message, the failing attribute, and the invalid value.
public ValidationException ( string errorMessage, System.ComponentModel.DataAnnotations.ValidationAttribute validatingAttribute, object value ) : System.Runtime.Serialization
errorMessage string The localized error message
validatingAttribute System.ComponentModel.DataAnnotations.ValidationAttribute The attribute that triggered this exception
value object The value that caused the validating attribute to trigger the exception
Résultat System.Runtime.Serialization