Compatible with special parameter names

This commit is contained in:
sunkaixuan 2023-07-14 10:46:29 +08:00
parent e5d831fd9c
commit a3f88c9874
2 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,7 @@ namespace SqlSugar
if (Parameter.ParameterName != null && Parameter.ParameterName.ToLower().IsContainsIn(KeyWord))
{
var newName = ":p" + i + 100;
sql = sql.Replace(Parameter.ParameterName, newName);
sql = Regex.Replace(sql, Parameter.ParameterName, newName, RegexOptions.IgnoreCase);
Parameter.ParameterName = newName;
i++;
}

View File

@ -134,7 +134,7 @@ namespace SqlSugar
if (parameters.Count(it => it.ParameterName.StartsWith(Parameter.ParameterName)) == 1)
{
var newName = Parameter.ParameterName + "_01";
sql = sql.Replace(Parameter.ParameterName, newName);
sql = Regex.Replace(sql, Parameter.ParameterName, newName, RegexOptions.IgnoreCase);
Parameter.ParameterName = newName;
}
else