Browse Source

Update Queryable.ToSqlString()

SqlSugar5
sunkaixuan 2 years ago
parent
commit
acb1bc3cb5
  1. 4
      Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs

4
Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs

@ -823,6 +823,10 @@ namespace SqlSugar
{ {
result = result.Replace(item.ParameterName, item.Value.ObjToString()); result = result.Replace(item.ParameterName, item.Value.ObjToString());
} }
else if (item.Value is DateTime)
{
result = result.Replace(item.ParameterName, "'"+item.Value.ObjToDate().ToString("yyyy-MM-dd HH:mm:ss.fff")+"'");
}
else if (item.Value is byte[]) else if (item.Value is byte[])
{ {
result = result.Replace(item.ParameterName, "0x" + BitConverter.ToString((byte[])item.Value)); result = result.Replace(item.ParameterName, "0x" + BitConverter.ToString((byte[])item.Value));

Loading…
Cancel
Save