C# Class Pathoschild.DesignByContract.NotBlankAttribute

Inheritance: System.Attribute, IParameterPrecondition, IReturnValuePrecondition
Afficher le fichier Open project: Pathoschild/DesignByContract

Protected Properties

Свойство Type Description
RaiseErrorOnNull bool

Méthodes publiques

Méthode Description
OnParameterPrecondition ( ParameterMetadata parameter, object value ) : void

Validate the requirement on a single method parameter or property setter value.

OnReturnValuePrecondition ( ReturnValueMetadata returnValue, object value ) : void

Validate the requirement on a method or property return value.

Méthodes protégées

Méthode Description
IsNull ( object value ) : bool

Get whether the value is null and RaiseErrorOnNull is true.

IsWhitespace ( object value ) : bool

Get whether the value is a string which is empty or consists entirely of whitespace.

Method Details

IsNull() protected méthode

Get whether the value is null and RaiseErrorOnNull is true.
protected IsNull ( object value ) : bool
value object The value to check.
Résultat bool

IsWhitespace() protected méthode

Get whether the value is a string which is empty or consists entirely of whitespace.
protected IsWhitespace ( object value ) : bool
value object The value to check.
Résultat bool

OnParameterPrecondition() public méthode

Validate the requirement on a single method parameter or property setter value.
The contract requirement was not met.
public OnParameterPrecondition ( ParameterMetadata parameter, object value ) : void
parameter Pathoschild.DesignByContract.Framework.ParameterMetadata The parameter metadata.
value object The parameter value.
Résultat void

OnReturnValuePrecondition() public méthode

Validate the requirement on a method or property return value.
The contract requirement was not met.
public OnReturnValuePrecondition ( ReturnValueMetadata returnValue, object value ) : void
returnValue Pathoschild.DesignByContract.Framework.ReturnValueMetadata The return value metadata.
value object The return value.
Résultat void

Property Details

RaiseErrorOnNull protected_oe property

Whether to raise a validation error on null values.
protected bool RaiseErrorOnNull
Résultat bool