- 调整 Aop 改为 event 事件;

- 调整 Ado.AopCommandExecuting/AopCommandExecuted 到 Aop.CommandBefore/After;
- 增加 Aop.TraceBefore/After 事件;
This commit is contained in:
28810
2020-03-02 18:57:53 +08:00
parent 32703e016a
commit 24cc8bc1da
58 changed files with 1109 additions and 638 deletions

View File

@ -172,7 +172,9 @@ namespace FreeSql
DbContextExecCommand();
//删除没有保存的数据
var propValEach = GetItemValue(item, prop) as IEnumerable;
_db.Orm.Delete<object>().AsType(tref.RefEntityType).WhereDynamic(propValEach, true).ExecuteAffrows();
_db.Orm.Delete<object>().AsType(tref.RefEntityType)
.WithTransaction(_uow?.GetOrBeginTransaction())
.WhereDynamic(propValEach, true).ExecuteAffrows();
}
}
finally
@ -225,7 +227,8 @@ namespace FreeSql
if (curList.Any() == false) //全部删除
{
var delall = _db.Orm.Delete<object>().AsType(tref.RefMiddleEntityType);
var delall = _db.Orm.Delete<object>().AsType(tref.RefMiddleEntityType)
.WithTransaction(_uow?.GetOrBeginTransaction());
foreach (var midWhere in midWheres) delall.Where(midWhere);
var sql = delall.ToSql();
delall.ExecuteAffrows();