C# Class Nettiers.AdventureWorks.Entities.Validation.ValidationRules

显示文件 Open project: netTiers/netTiers

Private Properties

Property Type Description
GetPropertyRules List
ValidateRuleList void
ValidationRules System

Public Methods

Method Description
AddRule ( ValidationRuleHandler handler, ValidationRuleArgs args ) : void

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

AddRule ( ValidationRuleHandler handler, string propertyName ) : void

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

Clear ( ) : void

Clear the rules list.

GetBrokenRules ( ) : BrokenRulesList

Return a BrokenRulesList that contains all of the invalid rules.

ValidateRules ( ) : void

Validate all the rules for all properties.

ValidateRules ( string propertyName ) : void

Validates all rules for a property

Private Methods

Method Description
GetPropertyRules ( string propertyName ) : List

Returns a list of ValidationRuleInfo objects for a specified property.

ValidateRuleList ( List ruleList ) : void

Validates a list of rules.

This method calls the Invoke method on each rule in the list. If the rule fails, it is added to the BrokenRulesList

ValidationRules ( object businessEntity ) : System

Creates an instance of the class and associates the target.

Method Details

AddRule() public method

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

public AddRule ( ValidationRuleHandler handler, ValidationRuleArgs args ) : void
handler ValidationRuleHandler The method that implements the rule.
args ValidationRuleArgs /// A object specifying the property name and other arguments /// passed to the rule method ///
return void

AddRule() public method

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

public AddRule ( ValidationRuleHandler handler, string propertyName ) : void
handler ValidationRuleHandler The method that implements the rule.
propertyName string /// The name of the property on the target object where the rule implementation can retrieve /// the value to be validated. ///
return void

Clear() public method

Clear the rules list.
public Clear ( ) : void
return void

GetBrokenRules() public method

Return a BrokenRulesList that contains all of the invalid rules.
public GetBrokenRules ( ) : BrokenRulesList
return BrokenRulesList

ValidateRules() public method

Validate all the rules for all properties.
public ValidateRules ( ) : void
return void

ValidateRules() public method

Validates all rules for a property
public ValidateRules ( string propertyName ) : void
propertyName string Name of the property to validate.
return void