28810 d7877924a5 - 调整 DbContext.EntityChangeInfo 类名为 DbContext.EntityChangeReport.ChangeInfo;
- 调整 IUnitOfWork 接口,移除 OnEntityChange 属性,增加 EntityChangeReport 属性;
2019-10-15 19:18:31 +08:00

43 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
namespace FreeSql
{
public interface IUnitOfWork : IDisposable
{
DbTransaction GetOrBeginTransaction(bool isCreate = true);
IsolationLevel? IsolationLevel { get; set; }
/// <summary>
/// 是否启用工作单元
/// </summary>
bool Enable { get; }
void Commit();
void Rollback();
/// <summary>
/// 禁用工作单元
/// <exception cref="Exception"></exception>
/// <para></para>
/// 若已开启事务已有Insert/Update/Delete操作调用此方法将发生异常建议在执行逻辑前调用
/// </summary>
void Close();
/// <summary>
/// 开启工作单元
/// </summary>
void Open();
/// <summary>
/// 此工作单元内的实体变化跟踪
/// </summary>
DbContext.EntityChangeReport EntityChangeReport { get; }
}
}