mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Update DateOnly
This commit is contained in:
@@ -736,6 +736,7 @@ namespace SqlSugar
|
|||||||
var addItem = readerValues[info];
|
var addItem = readerValues[info];
|
||||||
if (addItem == DBNull.Value)
|
if (addItem == DBNull.Value)
|
||||||
addItem = null;
|
addItem = null;
|
||||||
|
var underType = UtilMethods.GetUnderType(prop.PropertyType);
|
||||||
if (prop.PropertyType == UtilConstants.IntType)
|
if (prop.PropertyType == UtilConstants.IntType)
|
||||||
{
|
{
|
||||||
addItem = addItem.ObjToInt();
|
addItem = addItem.ObjToInt();
|
||||||
@@ -752,6 +753,10 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
addItem = addItem.ObjToInt();
|
addItem = addItem.ObjToInt();
|
||||||
}
|
}
|
||||||
|
else if (addItem!=null&&underType?.FullName == "System.DateOnly")
|
||||||
|
{
|
||||||
|
addItem = Convert.ToDateTime(addItem).ToString("yyyy-MM-dd");
|
||||||
|
}
|
||||||
else if (UtilMethods.GetUnderType(prop.PropertyType).IsEnum() && addItem is decimal)
|
else if (UtilMethods.GetUnderType(prop.PropertyType).IsEnum() && addItem is decimal)
|
||||||
{
|
{
|
||||||
if (prop.PropertyType.IsEnum() == false && addItem == null)
|
if (prop.PropertyType.IsEnum() == false && addItem == null)
|
||||||
|
Reference in New Issue
Block a user