Show / Hide Table of Contents

Class ValidationException

Represents the exception that is thrown when one or more properties is not valid.

Inheritance
Object
Exception
ValidationException
Inherited Members
System.Exception.GetBaseException()
System.Exception.ToString()
System.Exception.GetType()
System.Exception.Message
System.Exception.Data
Exception.InnerException
System.Exception.TargetSite
System.Exception.StackTrace
Exception.HelpLink
System.Exception.Source
Exception.HResult
System.Exception.SerializeObjectState
Object.Equals(Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
Object.MemberwiseClone()
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
Exception.GetObjectData(SerializationInfo, StreamingContext)
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.

Extension Methods

ObjectExtensions.DeepClone<T>(T)
ExceptionExtensions.GetSleepDuration(Exception, TimeSpan)
AnnotationsExtensions.IsValid(Object)
Back to top Generated by DocFX