Skip to content

T_Ifp_Validation_RuleBasedValidator_1

Martin Strecker edited this page Mar 9, 2019 · 6 revisions

RuleBasedValidator(T) Class

A validator that takes a set of objects that implement the IValidationRule(T) interface. Use the ValidationRule(T) class or the ValidationRuleDelegate(T) class as base for the implementation of rules.

Inheritance Hierarchy

System.Object
  Ifp.Validation.Validator(T)
    Ifp.Validation.RuleBasedValidator(T)
Namespace: Ifp.Validation
Assembly: Ifp.Validation (in Ifp.Validation.dll) Version: 1.4.0

Syntax

C#

public class RuleBasedValidator<T> : Validator<T>

VB

Public Class RuleBasedValidator(Of T)
	Inherits Validator(Of T)

C++

generic<typename T>
public ref class RuleBasedValidator : public Validator<T>

F#

type RuleBasedValidator<'T> =  
    class
        inherit Validator<'T>
    end

Type Parameters

 

T
The type of the object to validate
  The RuleBasedValidator(T) type exposes the following members.

Constructors

 

Name Description
Public method RuleBasedValidator(T)(IValidationRule(T)[]) Constructs a validator that applies the given validation rules to an object in the given order.
Public method RuleBasedValidator(T)(IEnumerable(IValidationRule(T))) Constructs a validator that applies the given validation rules to an object in the given order.
  Back to Top

Properties

 

Name Description
Protected property Rules The rules passed in the constructor.
  Back to Top

Methods

 

Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method ProcessValidations Processes the Rules one after the other and stops if a rule returns a ValidationOutcome with IsAnError and CausesValidationProcessToStop both set to true.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Validate Validates an object by applying the rules given in the constructor RuleBasedValidator(T) to the object in the order specified in the constructor./> (Overrides Validator(T).Validate(T).)
  Back to Top

See Also

Reference

Ifp.Validation Namespace

Clone this wiki locally