Synchronization code

This commit is contained in:
sunkaixuan
2023-12-08 10:32:59 +08:00
parent ca5979ac51
commit f7be5ae3bb
2 changed files with 14 additions and 4 deletions

View File

@@ -169,11 +169,21 @@ namespace SqlSugar
.ExecuteCommand(); .ExecuteCommand();
} }
else else
{
if (this._Context?.CurrentConnectionConfig?.MoreSettings?.IsAutoDeleteQueryFilter == true)
{
this._Context.Deleteable<object>()
.AS(thisEntity.DbTableName)
.EnableQueryFilter(thisEntity.Type)
.In(thisFkColumn.DbColumnName, ids.Distinct().ToList()).ExecuteCommand();
}
else
{ {
this._Context.Deleteable<object>() this._Context.Deleteable<object>()
.AS(thisEntity.DbTableName) .AS(thisEntity.DbTableName)
.In(thisFkColumn.DbColumnName, ids.Distinct().ToList()).ExecuteCommand(); .In(thisFkColumn.DbColumnName, ids.Distinct().ToList()).ExecuteCommand();
} }
}
_NavigateType = NavigateType.OneToMany; _NavigateType = NavigateType.OneToMany;
InsertDatas(children, thisPkColumn); InsertDatas(children, thisPkColumn);
} }

View File

@@ -2,7 +2,7 @@
<package > <package >
<metadata> <metadata>
<id>SqlSugarCore</id> <id>SqlSugarCore</id>
<version>5.1.4.125</version> <version>5.1.4.127-preview13</version>
<authors>sunkaixuan</authors> <authors>sunkaixuan</authors>
<owners>果糖大数据科技</owners> <owners>果糖大数据科技</owners>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl> <licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>