- 修复 BaseRepository.UnitOfWork 延迟设置无效的 bug;

This commit is contained in:
28810
2020-01-03 22:06:23 +08:00
parent d12bfc2f8c
commit 77463154e1
2 changed files with 179 additions and 193 deletions

View File

@ -63,7 +63,16 @@ namespace FreeSql
public DbContextOptions DbContextOptions { get => _db.Options; set => _db.Options = value; }
public IFreeSql Orm { get; private set; }
public IUnitOfWork UnitOfWork { get; set; }
IUnitOfWork _unitOfWork;
public IUnitOfWork UnitOfWork
{
set
{
_unitOfWork = value;
if (_dbsetPriv != null) _dbsetPriv._uow = _unitOfWork; //防止 dbset 对象已经存在,再次设置 UnitOfWork 无法生效,所以作此判断重新设置
}
get => _unitOfWork;
}
public IUpdate<TEntity> UpdateDiy => _dbset.OrmUpdateInternal(null);
public ISelect<TEntity> Select => _dbset.OrmSelectInternal(null);