Class ValidationException
Represents the exception that is thrown when one or more properties is not valid.
Inherited Members
Namespace: IRM.ComponentModel.DataAnnotations
Assembly: IRM.dll
Syntax
[Serializable]
public class ValidationException : Exception, ISerializable, _Exception
Constructors
ValidationException(ValidationResults)
Initializes a new instance of the ValidationException class with a sepcified ValidationResults.
Declaration
public ValidationException(ValidationResults results)
Parameters
ValidationResults
results
A list of validation results. |
ValidationException(SerializationInfo, StreamingContext)
Initializes a new instance of the ValidationException class with serialized data.
Declaration
protected ValidationException(SerializationInfo info, StreamingContext context)
Parameters
SerializationInfo
info
The object that holds the serialized object data. |
StreamingContext
context
The contextual information about the source or destination. |
Remarks
This constructor is called during deserialization to reconstitute the exception object transmitted over a stream.
ValidationException(String, ValidationResults)
Initializes a new instance of the ValidationException class with a specified error message and ValidationResults.
Declaration
public ValidationException(string message, ValidationResults results)
Parameters
String
message
The error message that explains the reason for the exception. |
ValidationResults
results
A list of validation results. |
ValidationException(String, Exception, ValidationResults)
Initializes a new instance of the ValidationException class with a specified error message, a reference to the inner exception that is the cause of this exception and ValidationResults.
Declaration
public ValidationException(string message, Exception innerException, ValidationResults results)
Parameters
String
message
The error message that explains the reason for the exception. |
Exception
innerException
The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. |
ValidationResults
results
A list of validation results. |
Properties
Results
Gets a ValidationResults with a list of validation results.
Declaration
public ValidationResults Results { get; }
Property Value
ValidationResults
|
Methods
GetObjectData(SerializationInfo, StreamingContext)
When overridden in a derived class, sets the SerializationInfo with information about the exception.
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
SerializationInfo
info
The object that holds the serialized object data. |
StreamingContext
context
The contextual information about the source or destination. |
Overrides
Remarks
GetObjectData sets a SerializationInfo with all the exception object data targeted for serialization. During deserialization, the exception is reconstituted from the SerializationInfo transmitted over the stream.