|
|
@@ -19,7 +19,7 @@ namespace MongoDB.Driver |
|
|
|
public CapMongoDbClientSessionHandle(ICapTransaction transaction) |
|
|
|
{ |
|
|
|
_transaction = transaction; |
|
|
|
_sessionHandle = (IClientSessionHandle)_transaction.DbTransaction; |
|
|
|
_sessionHandle = (IClientSessionHandle)_transaction.DbTransaction!; |
|
|
|
} |
|
|
|
|
|
|
|
public void Dispose() |
|
|
@@ -59,7 +59,7 @@ namespace MongoDB.Driver |
|
|
|
return Task.CompletedTask; |
|
|
|
} |
|
|
|
|
|
|
|
public void StartTransaction(TransactionOptions transactionOptions = null) |
|
|
|
public void StartTransaction(TransactionOptions? transactionOptions = null) |
|
|
|
{ |
|
|
|
_sessionHandle.StartTransaction(transactionOptions); |
|
|
|
} |
|
|
@@ -78,12 +78,12 @@ namespace MongoDB.Driver |
|
|
|
return _sessionHandle.Fork(); |
|
|
|
} |
|
|
|
|
|
|
|
public TResult WithTransaction<TResult>(Func<IClientSessionHandle, CancellationToken, TResult> callback, TransactionOptions transactionOptions = null, CancellationToken cancellationToken = default) |
|
|
|
public TResult WithTransaction<TResult>(Func<IClientSessionHandle, CancellationToken, TResult> callback, TransactionOptions? transactionOptions = null, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return _sessionHandle.WithTransaction(callback, transactionOptions, cancellationToken); |
|
|
|
} |
|
|
|
|
|
|
|
public Task<TResult> WithTransactionAsync<TResult>(Func<IClientSessionHandle, CancellationToken, Task<TResult>> callbackAsync, TransactionOptions transactionOptions = null, CancellationToken cancellationToken = default) |
|
|
|
public Task<TResult> WithTransactionAsync<TResult>(Func<IClientSessionHandle, CancellationToken, Task<TResult>> callbackAsync, TransactionOptions? transactionOptions = null, CancellationToken cancellationToken = default) |
|
|
|
{ |
|
|
|
return _sessionHandle.WithTransactionAsync(callbackAsync, transactionOptions, cancellationToken); |
|
|
|
} |
|
|
|