Browse Source

Synchronization code

pull/36/head
sunkaixuan 1 year ago
parent
commit
c0f97ca127
  1. 4
      Src/Asp.Net/SqlSugar/Json2Sql/ModelToSql/SqlPart.cs

4
Src/Asp.Net/SqlSugar/Json2Sql/ModelToSql/SqlPart.cs

@ -113,12 +113,14 @@ namespace SqlSugar
var parname = GetParameterName(pars, parvalue);
return parname;
}
private int GetParameterNameIndex = 100;
private string GetParameterName(List<SugarParameter> pars, object parvalue)
{
var parname = "@p" + pars.Count()+"_"+this.QueryBuilder.WhereIndex;
var parname = "@p" + pars.Count()+"_"+(this?.QueryBuilder?.WhereIndex?? GetParameterNameIndex);
SugarParameter parameter = new SugarParameter(parname, parvalue);
pars.Add(parameter);
GetParameterNameIndex++;
return parname;
}
#endregion

Loading…
Cancel
Save