public Task <CompletableSynchronizedStorageSession> OpenSession(ContextBag contextBag)
        {
            var session = contextBag.GetSession();
            var synchronizedStorageSession = new MartenSynchronizedStorageSession(session, true);

            return(Task.FromResult((CompletableSynchronizedStorageSession)synchronizedStorageSession));
        }
示例#2
0
        public Task <CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context)
        {
            Transaction ambientTransaction;

            if (transportTransaction.TryGet(out ambientTransaction))
            {
                var session = context.GetSession();
                CompletableSynchronizedStorageSession completableSynchronizedStorageSession = new MartenSynchronizedStorageSession(session, true);
                return(Task.FromResult(completableSynchronizedStorageSession));
            }

            return(EmptyResult);
        }