mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 调整 Aop 改为 event 事件;
- 调整 Ado.AopCommandExecuting/AopCommandExecuted 到 Aop.CommandBefore/After; - 增加 Aop.TraceBefore/After 事件;
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user