Validator Class Breeze.sharp
Subclassed instances of the Validator class provide the logic to validate another object and provide a description of any errors encountered during the validation process. They are typically associated with a 'validators' property on the following types: EntityType, DataProperty or NavigationProperty. A number of property level validators are registered automatically, i.e added to each DataProperty.Validators property based on DataProperty metadata. For example, DataProperty.MaxLength -> MaxLengthValidator DataProperty.IsNullable -> RequiredValidator (if not nullable)
Inheritance Hierarchy

SystemObject
  Breeze.SharpInternable
    Breeze.SharpValidator
      Breeze.SharpMaxLengthValidator
      Breeze.SharpRangeValidatorT
      Breeze.SharpRegexValidator
      Breeze.SharpRequiredValidator
      Breeze.SharpStringLengthValidator

Namespace: Breeze.Sharp
Assembly: Breeze.Sharp (in Breeze.Sharp.dll) Version: 0.6.0.5 (0.6.0.5)
Syntax

public abstract class Validator : Internable

The Validator type exposes the following members.

Constructors

  NameDescription
Protected methodValidator
Initializes a new instance of the Validator class
Top
Methods

  NameDescription
Public methodEquals (Inherited from Internable.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFindOrCreate
For internal use only - used during validator deserialization.
Public methodGetErrorMessage
Provides the error message associated with a failure of this validator.
Public methodGetHashCode (Inherited from Internable.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Performs validation given a specified context.
Protected methodValidateCore
Provides the core validation logic to this validator.
Top
Fields

  NameDescription
Public fieldStatic memberSuffix
Top
Properties

  NameDescription
Public propertyLocalizedKey
Public propertyLocalizedMessage
Public propertyName (Inherited from Internable.)
Top
Remarks

Validators are by convention immutable - if this convention is violated your app WILL break. You can use 'With' methods to create new Validators based on an existing validator. For example, to change the message you might do the following: var newValidator = new RequiredValidator().With(new LocalizedMessage("foo"));
See Also

Reference