Exemplo n.º 1
0
        public Task <CompletableSynchronizedStorageSession> OpenSession(ContextBag contextBag)
        {
            var session = contextBag.GetAsyncSession();
            var synchronizedStorageSession = new RavenDBSynchronizedStorageSession(session);

            return(Task.FromResult((CompletableSynchronizedStorageSession)synchronizedStorageSession));
        }
 public Task<CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context)
 {
     Transaction ambientTransaction;
     if (transportTransaction.TryGet(out ambientTransaction))
     {
         var session = context.GetAsyncSession();
         CompletableSynchronizedStorageSession completableSynchronizedStorageSession = new RavenDBSynchronizedStorageSession(session, true);
         return Task.FromResult(completableSynchronizedStorageSession);
     }
     return EmptyResult;
 }
        public Task <CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context)
        {
            // ReSharper disable once NotAccessedVariable - No way to just check for existence otherwise
            Transaction ambientTransaction;

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