Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
01a07b3c49
  1. 20
      SqlSugar/Realization/SqlServer/SqlServerProvider.cs

20
SqlSugar/Realization/SqlServer/SqlServerProvider.cs

@ -77,19 +77,19 @@ namespace SqlSugar
{ {
if (parameters == null || parameters.Length == 0) return null; if (parameters == null || parameters.Length == 0) return null;
SqlParameter[] result = new SqlParameter[parameters.Length]; SqlParameter[] result = new SqlParameter[parameters.Length];
int i = 0; int index = 0;
foreach (var parameter in parameters) foreach (var parameter in parameters)
{ {
if (parameter.Value == null) parameter.Value = DBNull.Value; if (parameter.Value == null) parameter.Value = DBNull.Value;
var p = new SqlParameter(); var sqlParameter = new SqlParameter();
p.ParameterName = parameter.ParameterName; sqlParameter.ParameterName = parameter.ParameterName;
p.UdtTypeName = parameter.UdtTypeName; sqlParameter.UdtTypeName = parameter.UdtTypeName;
p.Size = parameter.Size; sqlParameter.Size = parameter.Size;
p.Value = parameter.Value; sqlParameter.Value = parameter.Value;
p.DbType = parameter.DbType; sqlParameter.DbType = parameter.DbType;
p.Direction = parameter.Direction; sqlParameter.Direction = parameter.Direction;
result[i] = p; result[index] = sqlParameter;
++i; ++index;
} }
return result; return result;
} }

Loading…
Cancel
Save