Class ArgumentValidationException
- Namespace
- Acuit.Pinpoint.Common.Validation
- Assembly
- Acuit.Pinpoint.Common.dll
The exception that is thrown when an argument fails validation.
public class ArgumentValidationException : ArgumentException, ISerializable
- Inheritance
-
ArgumentValidationException
- Implements
- Inherited Members
- Extension Methods
Constructors
ArgumentValidationException()
Initializes a new instance of ArgumentValidationException.
public ArgumentValidationException()
ArgumentValidationException(IDictionary<string, string[]>, string?)
Initializes a new instance of ArgumentValidationException with a set of validation errors and the parameter name.
public ArgumentValidationException(IDictionary<string, string[]> errors, string? paramName)
Parameters
errorsIDictionary<string, string[]>The set of validation errors.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
errorsis null.
ArgumentValidationException(IEnumerable<KeyValuePair<string, string[]>>, string?)
Initializes a new instance of ArgumentValidationException with a set of validation errors and the parameter name.
public ArgumentValidationException(IEnumerable<KeyValuePair<string, string[]>> errors, string? paramName)
Parameters
errorsIEnumerable<KeyValuePair<string, string[]>>The set of validation errors.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
errorsis null.
ArgumentValidationException(IEnumerable<ValidationResult>, string?)
Initializes a new instance of ArgumentValidationException with validation errors generated from a list of validation results and the parameter name.
public ArgumentValidationException(IEnumerable<ValidationResult> validationResults, string? paramName)
Parameters
validationResultsIEnumerable<ValidationResult>The list of validation results.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
validationResultsis null.
ArgumentValidationException(string)
Initializes a new instance of ArgumentValidationException with a specified error message.
public ArgumentValidationException(string message)
Parameters
messagestringThe message that describes the error.
ArgumentValidationException(string?, IDictionary<string, string[]>, string?)
Initializes a new instance of ArgumentValidationException with a specified error message, a set of validation errors, and the parameter name.
public ArgumentValidationException(string? message, IDictionary<string, string[]> errors, string? paramName)
Parameters
messagestringThe message that describes the error.
errorsIDictionary<string, string[]>The set of validation errors.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
errorsis null.
ArgumentValidationException(string?, IEnumerable<KeyValuePair<string, string[]>>, string?)
Initializes a new instance of ArgumentValidationException with a specified error message, a set of validation errors, and the parameter name.
public ArgumentValidationException(string? message, IEnumerable<KeyValuePair<string, string[]>> errors, string? paramName)
Parameters
messagestringThe message that describes the error.
errorsIEnumerable<KeyValuePair<string, string[]>>The set of validation errors.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
errorsis null.
ArgumentValidationException(string?, IEnumerable<ValidationResult>, string?)
Initializes a new instance of ArgumentValidationException with a specified error message, validation errors generated from a list of validation results, and the parameter name.
public ArgumentValidationException(string? message, IEnumerable<ValidationResult> validationResults, string? paramName)
Parameters
messagestringThe message that describes the error.
validationResultsIEnumerable<ValidationResult>The list of validation results.
paramNamestringThe name of the parameter that caused the current exception.
Exceptions
- ArgumentNullException
validationResultsis null.
ArgumentValidationException(string, Exception)
Initializes a new instance of ArgumentValidationException with a specified error message and a reference to the inner exception that is the cause of this exception.
public ArgumentValidationException(string message, Exception inner)
Parameters
messagestringThe message that describes the error.
innerExceptionThe exception that is the cause of the current exception, or null if no inner exception is specified.
ArgumentValidationException(string?, string?)
Initializes a new instance of ArgumentValidationException with a specified error message and the name of the parameter that causes this exception.
public ArgumentValidationException(string? message, string? paramName)
Parameters
messagestringThe error message that explains the reason for the exception.
paramNamestringThe name of the parameter that caused the current exception.
ArgumentValidationException(string?, string?, Exception?)
Initializes a new instance of ArgumentValidationException with a specified error message, the parameter name, and a reference to the inner exception that is the cause of this exception.
public ArgumentValidationException(string? message, string? paramName, Exception? innerException)
Parameters
messagestringThe error message that explains the reason for the exception.
paramNamestringThe name of the parameter that caused the current exception.
innerExceptionExceptionThe exception that is the cause of the current exception. If the
innerExceptionparameter is not null, the current exception is raised in acatchblock that handles the inner exception.
ArgumentValidationException(string, string, string?)
Initializes a new instance of ArgumentValidationException with a single validation error and the parameter name.
public ArgumentValidationException(string key, string errorMessage, string? paramName)
Parameters
keystringThe key of the entry.
errorMessagestringThe error message.
paramNamestringThe name of the parameter that caused the current exception.
ArgumentValidationException(string?, string, string, string?)
Initializes a new instance of ArgumentValidationException with a specified error message, a single validation error, and the parameter name.
public ArgumentValidationException(string? message, string key, string errorMessage, string? paramName)
Parameters
messagestringThe message that describes the error.
keystringThe key of the entry.
errorMessagestringThe error message.
paramNamestringThe name of the parameter that caused the current exception.
Properties
Errors
Gets the validation errors.
public IDictionary<string, string[]> Errors { get; }
Property Value
- IDictionary<string, string[]>
Methods
ThrowIfNotValid(object?, string?)
Validates argument using RecursiveValidator and throws an ArgumentNullException if it is
null or an ArgumentValidationException if it is not valid.
public static void ThrowIfNotValid(object? argument, string? paramName = null)