C# Class Breeze.ContextProvider.ContextProvider

Afficher le fichier Open project: Breeze/breeze.server.net Class Usage Examples

Protected Properties

Свойство Type Description
KeyGeneratorType Lazy

Méthodes publiques

Méthode Description
CreateEntityInfo ( Object entity, System.Data.EntityState entityState = EntityState.Added ) : EntityInfo
ExtractSaveOptions ( dynamic dynSaveBundle ) : SaveOptions
GetDbConnection ( ) : IDbConnection

Should only be called from BeforeSaveEntities and AfterSaveEntities.

GetKeyValues ( EntityInfo entityInfo ) : object[]
Metadata ( ) : string
SaveChanges ( Newtonsoft.Json.Linq.JObject saveBundle, Breeze.ContextProvider.TransactionSettings transactionSettings = null ) : SaveResult
XDocToJson ( System.Xml.Linq.XDocument xDoc ) : String

Méthodes protégées

Méthode Description
AfterSaveEntities ( Dictionary saveMap, List keyMappings ) : void

Called after the entities have been saved, and all the temporary keys have been replaced by real keys. The base implementation calls AfterSaveEntitiesDelegate, or does nothing if AfterSaveEntitiesDelegate is null.

BeforeSaveEntities ( Dictionary saveMap ) : List>.Dictionary

Called after BeforeSaveEntity, and before saving the entities to the persistence layer. Allows adding, changing, and removing entities prior to save. The base implementation returns the result of BeforeSaveEntitiesDelegate, or the unchanged saveMap if BeforeSaveEntitiesDelegate is null.

BeforeSaveEntity ( EntityInfo entityInfo ) : bool

The method is called for each entity to be saved before the save occurs. If this method returns 'false' then the entity will be excluded from the save. The base implementation returns the result of BeforeSaveEntityDelegate, or 'true' if BeforeSaveEntityDelegate is null.

BeginTransaction ( System isolationLevel ) : IDbTransaction
BuildJsonMetadata ( ) : String
CloseDbConnection ( ) : void

Internal use only. Should only be called by ContextProvider during SaveChanges. Closes the DbConnection used by the ContextProvider's implementation.

CreateEntityInfo ( ) : EntityInfo
CreateEntityInfoFromJson ( dynamic jo, Type entityType ) : EntityInfo
HandleSaveException ( Exception e, SaveWorkState saveWorkState ) : bool
InitializeSaveState ( Newtonsoft.Json.Linq.JObject saveBundle ) : void
LookupEntityType ( String entityTypeName ) : Type
OpenDbConnection ( ) : void

Internal use only. Should only be called by ContextProvider during SaveChanges. Opens the DbConnection used by the ContextProvider's implementation. Method must be idempotent; after it is called the first time, subsequent calls have no effect.

SaveChangesCore ( SaveWorkState saveWorkState ) : void

Private Methods

Méthode Description
CreateJsonSerializer ( ) : JsonSerializer
JsonToDictionary ( dynamic json ) : Object>.Dictionary
OpenAndSave ( SaveWorkState saveWorkState ) : void

Method Details

AfterSaveEntities() protected méthode

Called after the entities have been saved, and all the temporary keys have been replaced by real keys. The base implementation calls AfterSaveEntitiesDelegate, or does nothing if AfterSaveEntitiesDelegate is null.
protected AfterSaveEntities ( Dictionary saveMap, List keyMappings ) : void
saveMap Dictionary The same saveMap that was returned from BeforeSaveEntities
keyMappings List The mapping of temporary keys to real keys
Résultat void

BeforeSaveEntities() protected méthode

Called after BeforeSaveEntity, and before saving the entities to the persistence layer. Allows adding, changing, and removing entities prior to save. The base implementation returns the result of BeforeSaveEntitiesDelegate, or the unchanged saveMap if BeforeSaveEntitiesDelegate is null.
protected BeforeSaveEntities ( Dictionary saveMap ) : List>.Dictionary
saveMap Dictionary A List of EntityInfo for each Type
Résultat List>.Dictionary

BeforeSaveEntity() protected méthode

The method is called for each entity to be saved before the save occurs. If this method returns 'false' then the entity will be excluded from the save. The base implementation returns the result of BeforeSaveEntityDelegate, or 'true' if BeforeSaveEntityDelegate is null.
protected BeforeSaveEntity ( EntityInfo entityInfo ) : bool
entityInfo EntityInfo
Résultat bool

BeginTransaction() protected méthode

protected BeginTransaction ( System isolationLevel ) : IDbTransaction
isolationLevel System
Résultat IDbTransaction

BuildJsonMetadata() protected abstract méthode

protected abstract BuildJsonMetadata ( ) : String
Résultat String

CloseDbConnection() protected abstract méthode

Internal use only. Should only be called by ContextProvider during SaveChanges. Closes the DbConnection used by the ContextProvider's implementation.
protected abstract CloseDbConnection ( ) : void
Résultat void

CreateEntityInfo() protected méthode

protected CreateEntityInfo ( ) : EntityInfo
Résultat EntityInfo

CreateEntityInfo() public méthode

public CreateEntityInfo ( Object entity, System.Data.EntityState entityState = EntityState.Added ) : EntityInfo
entity Object
entityState System.Data.EntityState
Résultat EntityInfo

CreateEntityInfoFromJson() protected méthode

protected CreateEntityInfoFromJson ( dynamic jo, Type entityType ) : EntityInfo
jo dynamic
entityType System.Type
Résultat EntityInfo

ExtractSaveOptions() public static méthode

public static ExtractSaveOptions ( dynamic dynSaveBundle ) : SaveOptions
dynSaveBundle dynamic
Résultat SaveOptions

GetDbConnection() public abstract méthode

Should only be called from BeforeSaveEntities and AfterSaveEntities.
public abstract GetDbConnection ( ) : IDbConnection
Résultat IDbConnection

GetKeyValues() public méthode

public GetKeyValues ( EntityInfo entityInfo ) : object[]
entityInfo EntityInfo
Résultat object[]

HandleSaveException() protected méthode

protected HandleSaveException ( Exception e, SaveWorkState saveWorkState ) : bool
e System.Exception
saveWorkState SaveWorkState
Résultat bool

InitializeSaveState() protected méthode

protected InitializeSaveState ( Newtonsoft.Json.Linq.JObject saveBundle ) : void
saveBundle Newtonsoft.Json.Linq.JObject
Résultat void

LookupEntityType() protected méthode

protected LookupEntityType ( String entityTypeName ) : Type
entityTypeName String
Résultat System.Type

Metadata() public méthode

public Metadata ( ) : string
Résultat string

OpenDbConnection() protected abstract méthode

Internal use only. Should only be called by ContextProvider during SaveChanges. Opens the DbConnection used by the ContextProvider's implementation. Method must be idempotent; after it is called the first time, subsequent calls have no effect.
protected abstract OpenDbConnection ( ) : void
Résultat void

SaveChanges() public méthode

public SaveChanges ( Newtonsoft.Json.Linq.JObject saveBundle, Breeze.ContextProvider.TransactionSettings transactionSettings = null ) : SaveResult
saveBundle Newtonsoft.Json.Linq.JObject
transactionSettings Breeze.ContextProvider.TransactionSettings
Résultat SaveResult

SaveChangesCore() protected abstract méthode

protected abstract SaveChangesCore ( SaveWorkState saveWorkState ) : void
saveWorkState SaveWorkState
Résultat void

XDocToJson() public static méthode

public static XDocToJson ( System.Xml.Linq.XDocument xDoc ) : String
xDoc System.Xml.Linq.XDocument
Résultat String

Property Details

KeyGeneratorType protected_oe static_oe property

protected static Lazy KeyGeneratorType
Résultat Lazy