mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Update IsCorrectErrorSqlParameterName
This commit is contained in:
parent
a12ca13d73
commit
5683ee45e0
@ -113,6 +113,10 @@ namespace SqlSugar
|
||||
return 0;
|
||||
}
|
||||
var result = 0;
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsCorrectErrorSqlParameterName == true)
|
||||
{
|
||||
UpdateBuilder.Parameters = UpdateBuilder.Parameters.Where(it => UtilMethods.NoErrorParameter(it.ParameterName)).ToList();
|
||||
}
|
||||
if (sql != Environment.NewLine)
|
||||
{
|
||||
result = this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray());
|
||||
|
@ -1685,5 +1685,29 @@ namespace SqlSugar
|
||||
return string.Join(" AND ", wheres);
|
||||
}
|
||||
|
||||
internal static bool NoErrorParameter(string parameterName)
|
||||
{
|
||||
if (parameterName==null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (parameterName.Contains(" "))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (parameterName.Contains("("))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (parameterName.Contains("("))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (parameterName.Contains("."))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user