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