添加项目文件。
This commit is contained in:
27
Entities/Context/UnitOfWork/IUnitOfWorkOfT.cs
Normal file
27
Entities/Context/UnitOfWork/IUnitOfWorkOfT.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
namespace SharedDATA.Api
|
||||
{
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Defines the interface(s) for generic unit of work.
|
||||
/// </summary>
|
||||
public interface IUnitOfWork<TContext> : IUnitOfWork where TContext : DbContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the db context.
|
||||
/// </summary>
|
||||
/// <returns>The instance of type <typeparamref name="TContext"/>.</returns>
|
||||
TContext DbContext { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Saves all changes made in this context to the database with distributed transaction.
|
||||
/// </summary>
|
||||
/// <param name="ensureAutoHistory"><c>True</c> if save changes ensure auto record the change history.</param>
|
||||
/// <param name="unitOfWorks">An optional <see cref="IUnitOfWork"/> array.</param>
|
||||
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous save operation. The task result contains the number of state entities written to database.</returns>
|
||||
Task<int> SaveChangesAsync(bool ensureAutoHistory = false, params IUnitOfWork[] unitOfWorks);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user