- 修复 FreeSql.DbContext 析构方法的 bug,错误的回滚了外部 UnitOfWork;

This commit is contained in:
28810
2019-11-01 18:49:13 +08:00
parent 25d584ca39
commit b331630954
2 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,7 @@ namespace FreeSql
public IFreeSql Orm => _ormPriv ?? throw new ArgumentNullException("请在 OnConfiguring 或 AddFreeDbContext 中配置 UseFreeSql");
#region Property UnitOfWork
internal bool _isUseUnitOfWork = true; //是否使用工作单元事务
internal bool _isUseUnitOfWork = true; //是否创建工作单元事务
IUnitOfWork _uowPriv;
public IUnitOfWork UnitOfWork
{
@ -220,7 +220,8 @@ namespace FreeSql
_dicSet.Clear();
AllSets.Clear();
UnitOfWork?.Rollback();
if (_isUseUnitOfWork)
UnitOfWork?.Rollback();
}
finally
{