C# Class Breeze.ContextProvider.BreezeMetadataValidator

Validates entities using Breeze metadata.
Show file Open project: Breeze/breeze.server.net Class Usage Examples

Public Methods

Method Description
BreezeMetadataValidator ( ContextProvider contextProvider, object>.IDictionary breezeMetadata ) : System

Create a new instance.

BreezeMetadataValidator ( ContextProvider contextProvider, object>.List structuralTypeList ) : System

Create a new instance.

ValidateEntities ( Dictionary saveMap, bool throwIfInvalid ) : List

Validate all the entities in the saveMap.

ValidateEntity ( EntityInfo entityInfo, List entityErrors ) : bool

Validates a single entity. Skips validation (returns true) if entity is marked Deleted.

Private Methods

Method Description
BuildDataProperty ( object>.Dictionary data ) : DataProperty
BuildStructuralTypeMap ( object>.List structuralTypeList ) : StructuralType>.Dictionary
BuildValidator ( object>.Dictionary data ) : Validator

Method Details

BreezeMetadataValidator() public method

Create a new instance.
public BreezeMetadataValidator ( ContextProvider contextProvider, object>.IDictionary breezeMetadata ) : System
contextProvider ContextProvider Used for getting entity keys for building EntityError objects.
breezeMetadata object>.IDictionary Contains breeze metadata. The structuralTypeList is extracted from it.
return System

BreezeMetadataValidator() public method

Create a new instance.
public BreezeMetadataValidator ( ContextProvider contextProvider, object>.List structuralTypeList ) : System
contextProvider ContextProvider Used for getting entity keys for building EntityError objects.
structuralTypeList object>.List Contains the validator information for properties of entity and complex types.
return System

ValidateEntities() public method

Validate all the entities in the saveMap.
Contains all the EntityErrors. Only thrown if throwIfInvalid is true.
public ValidateEntities ( Dictionary saveMap, bool throwIfInvalid ) : List
saveMap Dictionary Map of type to entities.
throwIfInvalid bool If true, throws an EntityErrorsException if any entity is invalid
return List

ValidateEntity() public method

Validates a single entity. Skips validation (returns true) if entity is marked Deleted.
public ValidateEntity ( EntityInfo entityInfo, List entityErrors ) : bool
entityInfo EntityInfo contains the entity to validate
entityErrors List An EntityError is added to this list for each error found in the entity
return bool