Interface IUnitOfWork<TContext>
- Namespace
- Biwen.QuickApi.UnitOfWork
- Assembly
- Biwen.QuickApi.dll
Defines the interface(s) for generic unit of work.
public interface IUnitOfWork<out TContext> : IUnitOfWork, IDisposable where TContext : DbContext
Type Parameters
TContext
- Inherited Members
- Extension Methods
Properties
DbContext
Gets the db context.
TContext DbContext { get; }
Property Value
- TContext
The instance of type
TContext
.
Methods
SaveChangesAsync(params IUnitOfWork[])
Saves all changes made in this context to the database with distributed transaction.
Task<int> SaveChangesAsync(params IUnitOfWork[] unitOfWorks)
Parameters
unitOfWorks
IUnitOfWork[]An optional IUnitOfWork<TContext> array.
Returns
- Task<int>
A Task<TResult> that represents the asynchronous save operation. The task result contains the number of state entities written to database.