mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 10:24:55 +08:00
update DelteNavManyToMany
This commit is contained in:
@@ -40,7 +40,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
|
|
||||||
var childList = GetChildList<TChild>().In(thisPkColumn.DbColumnName, bids).ToList();
|
var childList = GetChildList<TChild>().In(thisPkColumn.DbColumnName, bids).ToList();
|
||||||
if (bids.Count != childList.Count)
|
if (_WhereList.HasValue())
|
||||||
{
|
{
|
||||||
bids = childList.Select(it => thisPkColumn.PropertyInfo.GetValue(it)).ToList();
|
bids = childList.Select(it => thisPkColumn.PropertyInfo.GetValue(it)).ToList();
|
||||||
}
|
}
|
||||||
@@ -55,9 +55,20 @@ namespace SqlSugar
|
|||||||
this._ParentPkColumn = thisPkColumn;
|
this._ParentPkColumn = thisPkColumn;
|
||||||
this._IsDeletedParant = true;
|
this._IsDeletedParant = true;
|
||||||
|
|
||||||
SetContext(() => _Context.Deleteable<object>().AS(mappingEntity.DbTableName).In(
|
|
||||||
mappingA.DbColumnName, aids
|
if (_WhereList.HasValue())
|
||||||
).ExecuteCommand());
|
{
|
||||||
|
SetContext(() => _Context.Deleteable<object>().AS(mappingEntity.DbTableName)
|
||||||
|
.In(mappingA.DbColumnName, aids)
|
||||||
|
.In(mappingA.DbColumnName, bids)
|
||||||
|
.ExecuteCommand());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetContext(() => _Context.Deleteable<object>().AS(mappingEntity.DbTableName).In(
|
||||||
|
mappingA.DbColumnName, aids
|
||||||
|
).ExecuteCommand());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user