Browse Source

Update SugarParameter

pull/30/head
sunkaixuan 2 years ago
parent
commit
3d1b906d2f
  1. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs
  2. 4
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs

@ -162,12 +162,12 @@ namespace SqlSugar
{ {
this.DbType = System.Data.DbType.UInt16; this.DbType = System.Data.DbType.UInt16;
} }
else if (type.Name == "TimeOnly") else if (type?.Name == "TimeOnly")
{ {
this.DbType = System.Data.DbType.Time; this.DbType = System.Data.DbType.Time;
this.Value = UtilMethods.TimeOnlyToTimeSpan(this.Value); this.Value = UtilMethods.TimeOnlyToTimeSpan(this.Value);
} }
else if (type.Name == "DateOnly") else if (type?.Name == "DateOnly")
{ {
this.DbType = System.Data.DbType.Date; this.DbType = System.Data.DbType.Date;
this.Value = UtilMethods.DateOnlyToDateTime(this.Value); this.Value = UtilMethods.DateOnlyToDateTime(this.Value);

4
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/Common/SugarParameter.cs

@ -162,12 +162,12 @@ namespace SqlSugar
{ {
this.DbType = System.Data.DbType.UInt16; this.DbType = System.Data.DbType.UInt16;
} }
else if (type.Name == "TimeOnly") else if (type?.Name == "TimeOnly")
{ {
this.DbType = System.Data.DbType.Time; this.DbType = System.Data.DbType.Time;
this.Value = UtilMethods.TimeOnlyToTimeSpan(this.Value); this.Value = UtilMethods.TimeOnlyToTimeSpan(this.Value);
} }
else if (type.Name == "DateOnly") else if (type?.Name == "DateOnly")
{ {
this.DbType = System.Data.DbType.Date; this.DbType = System.Data.DbType.Date;
this.Value = UtilMethods.DateOnlyToDateTime(this.Value); this.Value = UtilMethods.DateOnlyToDateTime(this.Value);

Loading…
Cancel
Save