MooTransaction Reference
Role#
MooTransaction represents an active SQL Server transaction created by db.BeginTransactionAsync(...) where db is a MooDbContext.
Properties#
Sql:MooSqlBulk:MooBulk
Main methods#
Task<int> ExecuteAsync(...)
Task<T> ScalarAsync<T>(...)
Task<T?> SingleAsync<T>(...)
Task<T?> SingleAsync<T>(..., Func<SqlDataReader, T> map, ...)
Task<List<T>> ListAsync<T>(...)
Task<List<T>> ListAsync<T>(..., Func<SqlDataReader, T> map, ...)
Task<TResult> QueryMultipleAsync<TResult>(..., Func<IMooMultiReader, TResult> read, ...)
Task CommitAsync(...)
ValueTask DisposeAsync()
Key points#
- all commands share the same connection and SQL transaction
- disposing an uncommitted transaction rolls it back automatically
- once committed, that transaction instance is complete and cannot be reused for more execution calls