ParameterValidationAttribute Class
A base class attribute used for parameter validation.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public abstract class ParameterValidationAttribute : Attribute
- Namespace
- Spectre
.Console .Cli - Base Types
-
- Attribute
Attributes
-
Attribute
Usage Attribute
Constructors
-
protected Parameter
Validation Attribute (string) -
Initializes a new instance of the
ParameterValidationAttribute
class.
Properties
- string ErrorMessage
- Gets the validation error message.
Methods
-
abstract ValidationResult Validate
( Command Parameter Context) - Validates the parameter value.
Extension Methods
-
T And
< Parameter Validation Attribute> (Action < Parameter Validation Attribute> ) - 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