Browse Source

Compatible with special parameter names

pull/40/head
sunkaixuan 1 year ago
parent
commit
a3f88c9874
  1. 2
      Src/Asp.Net/SqlSugar/Realization/Dm/DmProvider.cs
  2. 2
      Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs

2
Src/Asp.Net/SqlSugar/Realization/Dm/DmProvider.cs

@ -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++;
}

2
Src/Asp.Net/SqlSugar/Realization/Oracle/OracleProvider.cs

@ -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

Loading…
Cancel
Save