C# Class Pathoschild.DesignByContract.NotBlankAttribute

Inheritance: System.Attribute, IParameterPrecondition, IReturnValuePrecondition
Mostra file Open project: Pathoschild/DesignByContract

Protected Properties

Property Type Description
RaiseErrorOnNull bool

Public Methods

Method 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.

Protected Methods

Method 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 method

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

IsWhitespace() protected method

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.
return bool

OnParameterPrecondition() public method

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.
return void

OnReturnValuePrecondition() public method

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.
return void

Property Details

RaiseErrorOnNull protected_oe property

Whether to raise a validation error on null values.
protected bool RaiseErrorOnNull
return bool