public Task <CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context) { if (transportTransaction.TryGet(out Transaction ambientTransaction)) { var transaction = new InMemoryTransaction(); CompletableSynchronizedStorageSession session = new InMemorySynchronizedStorageSession(transaction); ambientTransaction.EnlistVolatile(new EnlistmentNotification(transaction), EnlistmentOptions.None); return(Task.FromResult(session)); } return(EmptyTask); }
public Task<CompletableSynchronizedStorageSession> TryAdapt(TransportTransaction transportTransaction, ContextBag context) { Transaction ambientTransaction; if (transportTransaction.TryGet(out ambientTransaction)) { var transaction = new InMemoryTransaction(); CompletableSynchronizedStorageSession session = new InMemorySynchronizedStorageSession(transaction); ambientTransaction.EnlistVolatile(new EnlistmentNotification(transaction), EnlistmentOptions.None); return Task.FromResult(session); } return EmptyTask; }
public void Dispose() { Transaction = null; }
public InMemoryOutboxTransaction() { Transaction = new InMemoryTransaction(); }
public InMemorySynchronizedStorageSession(InMemoryTransaction transaction) { Transaction = transaction; }
public EnlistmentNotification(InMemoryTransaction transaction) { this.transaction = transaction; }