コード例 #1
0
        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(OutboxTransaction transaction, ContextBag context)
        {
            var martenTransaction = transaction as MartenOutboxTransaction;

            if (martenTransaction != null)
            {
                CompletableSynchronizedStorageSession session = new MartenSynchronizedStorageSession(martenTransaction.Session, false);
                return(Task.FromResult(session));
            }

            return(EmptyResult);
        }
コード例 #3
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);
        }