mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Update DateOnly
This commit is contained in:
@@ -428,6 +428,21 @@ namespace SqlSugar
|
||||
GetDbColumnIndex++;
|
||||
return pname;
|
||||
}
|
||||
else if (columnInfo.PropertyType != null && columnInfo.PropertyType.Name == "DateOnly")
|
||||
{
|
||||
var timeSpan = UtilMethods.DateOnlyToDateTime(columnInfo.Value);
|
||||
var pname = Builder.SqlParameterKeyWord + columnInfo.DbColumnName + "_ts" + GetDbColumnIndex;
|
||||
if (timeSpan == null)
|
||||
{
|
||||
this.Parameters.Add(new SugarParameter(pname, null) { DbType = System.Data.DbType.Date });
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Parameters.Add(new SugarParameter(pname, Convert.ToDateTime(timeSpan)));
|
||||
}
|
||||
GetDbColumnIndex++;
|
||||
return pname;
|
||||
}
|
||||
else
|
||||
{
|
||||
return name + "";
|
||||
|
Reference in New Issue
Block a user