mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-29 10:49:36 +08:00
Update Deleteable by subquery
This commit is contained in:
parent
408a9d5786
commit
66a4a410e6
@ -226,6 +226,11 @@ namespace SqlSugar
|
||||
var expResult = DeleteBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle);
|
||||
var whereString = expResult.GetResultString();
|
||||
if (expression.ToString().Contains("Subqueryable()")) {
|
||||
if (expression.Parameters.First().Type == typeof(T))
|
||||
{
|
||||
var tableName = this.SqlBuilder.GetTranslationColumnName(this.EntityInfo.DbTableName);
|
||||
whereString = whereString.Replace(tableName, $"( SELECT * FROM {tableName}) ");
|
||||
}
|
||||
whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + ".");
|
||||
}
|
||||
else if (expResult.IsNavicate)
|
||||
|
Loading…
Reference in New Issue
Block a user