Update IsCorrectErrorSqlParameterName

This commit is contained in:
sunkaixuan 2025-03-14 11:19:17 +08:00
parent 12249dee26
commit 33a504019f
2 changed files with 13 additions and 1 deletions

View File

@ -780,7 +780,14 @@ namespace SqlSugar
string shortName = expression.Expression.ToString();
string fieldName = expression.Member.Name;
fieldName = this.Context.GetDbColumnName(expression.Expression.Type.Name, fieldName);
fieldName = Context.GetTranslationColumnName(shortName + UtilConstants.Dot + fieldName);
if (UtilMethods.GetMoreSetting(this.Context).IsCorrectErrorSqlParameterName)
{
fieldName = Context.GetTranslationColumnName(shortName) + UtilConstants.Dot + Context.GetTranslationColumnName(fieldName);
}
else
{
fieldName = Context.GetTranslationColumnName(shortName + UtilConstants.Dot + fieldName);
}
return fieldName;
}

View File

@ -1821,5 +1821,10 @@ namespace SqlSugar
}
return true;
}
internal static ConnMoreSettings GetMoreSetting(ExpressionContext context)
{
return context?.SugarContext?.Context?.CurrentConnectionConfig?.MoreSettings ?? new ConnMoreSettings();
}
}
}