public async Task <ICompletableSynchronizedStorageSession> OpenSession(ContextBag contextBag, CancellationToken cancellationToken = default) { var mongoSession = await client.StartSessionAsync(cancellationToken : cancellationToken).ConfigureAwait(false); var session = new StorageSession(mongoSession, databaseName, contextBag, collectionNamingConvention, true, useTransactions, transactionTimeout); session.StartTransaction(); return(session); }
public MongoOutboxTransaction(IClientSessionHandle mongoSession, string databaseName, ContextBag context, Func <Type, string> collectionNamingConvention, TimeSpan transactionTimeout) { StorageSession = new StorageSession(mongoSession, databaseName, context, collectionNamingConvention, false, true, transactionTimeout); StorageSession.StartTransaction(); }