Skip to content

T_Ifp_Validation_ValidationRuleDelegate_1

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

ValidationRuleDelegate(T) Class

A class that takes a ValidationFunction(T) delegate to perform the validation. This allows to define a validation rule without the need to implement a class that derives from ValidationRule(T).

Inheritance Hierarchy

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

Syntax

C#

public class ValidationRuleDelegate<T> : IValidationRule<T>

VB

Public Class ValidationRuleDelegate(Of T)
	Implements IValidationRule(Of T)

C++

generic<typename T>
public ref class ValidationRuleDelegate : IValidationRule<T>

F#

type ValidationRuleDelegate<'T> =  
    class
        interface IValidationRule<'T>
    end

Type Parameters

 

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

Constructors

 

Name Description
Public method ValidationRuleDelegate(T)(ValidationFunction(T)) Constructs a new ValidationRuleDelegate(T) object and takes a ValidationFunction(T) delegate that does the validation.
Public method ValidationRuleDelegate(T)(ValidationFunction(T), Boolean) Constructs a new ValidationRuleDelegate(T) object and takes a ValidationFunction(T) delegate that does the validation.
  Back to Top

Properties

 

Name Description
Public property CausesValidationProcessToStop Use the constructor ValidationRuleDelegate(T)(ValidationFunction(T), Boolean) to configure this property. Return true if the RuleBasedValidator(T) should not proceed validation tests in case this validation rule returns a ValidationOutcome with IsAnError. This is useful to prevent further processing of rules in cases where all the following rules will also fail. A typical use case is a check for objectToValidate == null.
Protected property ValidationFunction The ValidationFunction(T) passes to 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.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method ValidateObject Implements ValidateObject(T) by delegating to the validation function passed in the constructor.
  Back to Top

Extension Methods

 

Name Description
Public Extension Method ToValidator(T) Converts a IValidationRule(T) into an IValidator(T). (Defined by ValidationSummaryBuilderExtensions.)
  Back to Top

See Also

Reference

Ifp.Validation Namespace

Clone this wiki locally