forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
advanced_session_extention_base.go
32 lines (28 loc) · 1.13 KB
/
advanced_session_extention_base.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package ravendb
// AdvancedSessionExtensionBase implements common advanced session operations
type AdvancedSessionExtensionBase struct {
session *InMemoryDocumentSessionOperations
documents []*documentInfo
requestExecutor *RequestExecutor
sessionInfo *SessionInfo
documentStore *DocumentStore
deferredCommandsMap map[idTypeAndName]ICommandData
deletedEntities *objectSet
documentsByID *documentsByID
}
func newAdvancedSessionExtensionBase(session *InMemoryDocumentSessionOperations) *AdvancedSessionExtensionBase {
return &AdvancedSessionExtensionBase{
session: session,
documents: session.documentsByEntity,
requestExecutor: session.GetRequestExecutor(),
sessionInfo: session.sessionInfo,
documentStore: session.GetDocumentStore(),
deferredCommandsMap: session.deferredCommandsMap,
deletedEntities: session.deletedEntities,
documentsByID: session.documentsByID,
}
}
// Defer defers multiple commands to be executed on SaveChnages
func (e *AdvancedSessionExtensionBase) Defer(commands ...ICommandData) {
e.session.Defer(commands...)
}