C# Класс Breeze.ContextProvider.ContextProvider

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
KeyGeneratorType Lazy

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
CreateJsonSerializer ( ) : JsonSerializer
JsonToDictionary ( dynamic json ) : Object>.Dictionary
OpenAndSave ( SaveWorkState saveWorkState ) : void

Описание методов

AfterSaveEntities() защищенный Метод

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
Результат void

BeforeSaveEntities() защищенный Метод

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
Результат List>.Dictionary

BeforeSaveEntity() защищенный Метод

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
Результат bool

BeginTransaction() защищенный Метод

protected BeginTransaction ( System isolationLevel ) : IDbTransaction
isolationLevel System
Результат IDbTransaction

BuildJsonMetadata() защищенный абстрактный Метод

protected abstract BuildJsonMetadata ( ) : String
Результат String

CloseDbConnection() защищенный абстрактный Метод

Internal use only. Should only be called by ContextProvider during SaveChanges. Closes the DbConnection used by the ContextProvider's implementation.
protected abstract CloseDbConnection ( ) : void
Результат void

CreateEntityInfo() защищенный Метод

protected CreateEntityInfo ( ) : EntityInfo
Результат EntityInfo

CreateEntityInfo() публичный Метод

public CreateEntityInfo ( Object entity, System.Data.EntityState entityState = EntityState.Added ) : EntityInfo
entity Object
entityState System.Data.EntityState
Результат EntityInfo

CreateEntityInfoFromJson() защищенный Метод

protected CreateEntityInfoFromJson ( dynamic jo, Type entityType ) : EntityInfo
jo dynamic
entityType System.Type
Результат EntityInfo

ExtractSaveOptions() публичный статический Метод

public static ExtractSaveOptions ( dynamic dynSaveBundle ) : SaveOptions
dynSaveBundle dynamic
Результат SaveOptions

GetDbConnection() публичный абстрактный Метод

Should only be called from BeforeSaveEntities and AfterSaveEntities.
public abstract GetDbConnection ( ) : IDbConnection
Результат IDbConnection

GetKeyValues() публичный Метод

public GetKeyValues ( EntityInfo entityInfo ) : object[]
entityInfo EntityInfo
Результат object[]

HandleSaveException() защищенный Метод

protected HandleSaveException ( Exception e, SaveWorkState saveWorkState ) : bool
e System.Exception
saveWorkState SaveWorkState
Результат bool

InitializeSaveState() защищенный Метод

protected InitializeSaveState ( Newtonsoft.Json.Linq.JObject saveBundle ) : void
saveBundle Newtonsoft.Json.Linq.JObject
Результат void

LookupEntityType() защищенный Метод

protected LookupEntityType ( String entityTypeName ) : Type
entityTypeName String
Результат System.Type

Metadata() публичный Метод

public Metadata ( ) : string
Результат string

OpenDbConnection() защищенный абстрактный Метод

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
Результат void

SaveChanges() публичный Метод

public SaveChanges ( Newtonsoft.Json.Linq.JObject saveBundle, Breeze.ContextProvider.TransactionSettings transactionSettings = null ) : SaveResult
saveBundle Newtonsoft.Json.Linq.JObject
transactionSettings Breeze.ContextProvider.TransactionSettings
Результат SaveResult

SaveChangesCore() защищенный абстрактный Метод

protected abstract SaveChangesCore ( SaveWorkState saveWorkState ) : void
saveWorkState SaveWorkState
Результат void

XDocToJson() публичный статический Метод

public static XDocToJson ( System.Xml.Linq.XDocument xDoc ) : String
xDoc System.Xml.Linq.XDocument
Результат String

Описание свойств

KeyGeneratorType защищенное статическое свойство

protected static Lazy KeyGeneratorType
Результат Lazy