C# Class Pathoschild.DesignByContract.NotEmptyAttribute

Inheritance: System.Attribute, IParameterPrecondition, IReturnValuePrecondition
Datei anzeigen 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
IsEmpty ( object value ) : bool

Get whether the value is an empty enumeration.

IsNull ( object value ) : bool

Get whether the value is null and RaiseErrorOnNull is true.

Method Details

IsEmpty() protected method

Get whether the value is an empty enumeration.
protected IsEmpty ( object value ) : bool
value object The value to check.
return bool

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

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