ParameterValidationAttribute Class

A base class attribute used for parameter validation.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public abstract class ParameterValidationAttribute : Attribute
Base Types
  • Attribute

Attributes

AttributeUsageAttribute

Constructors

protected ParameterValidationAttribute(string)
Initializes a new instance of the ParameterValidationAttribute class.

Properties

string ErrorMessage
Gets the validation error message.

Methods

abstract ValidationResult Validate(CommandParameterContext)
Validates the parameter value.

Extension Methods

T And<ParameterValidationAttribute>(Action<ParameterValidationAttribute>)
Performs the specified action on the given object and then returns the object. Useful for fluent testing patterns where additional assertions or operations are chained together in a readable manner.

See Also

  • System.Attribute