Synchronization code

This commit is contained in:
sunkaixuan 2023-04-12 17:33:01 +08:00
parent 611964b051
commit 9503fb837d

View File

@ -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 + "";