public async Task<IDbTransaction> GetTransactionAsync() {
if (this.isDisposed) {
throw new ObjectDisposedException("Session");
}
if (this.isComplete) {
throw new InvalidOperationException("Transaction was marked as completed, no further operations are permitted");
}
if (this.transaction == null) {
if (!this.isTransactionLess) {
var thisConnection = await this.GetConnectionAsync();
this.transaction = thisConnection.BeginTransaction();
this.shouldCommitAndDisposeTransaction = true;
}
}
return this.transaction;
}