C# 클래스 Breeze.ContextProvider.ContextProvider

파일 보기 프로젝트 열기: Breeze/breeze.server.net 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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