public Task <CompletableSynchronizedStorageSession> OpenSession(ContextBag contextBag) { var session = contextBag.GetSession(); var synchronizedStorageSession = new MartenSynchronizedStorageSession(session, true); return(Task.FromResult((CompletableSynchronizedStorageSession)synchronizedStorageSession)); }
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); }