mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-24 16:43:17 +08:00
Update db.Reportable(DateOnly)
This commit is contained in:
@@ -277,7 +277,7 @@ namespace SqlSugar
|
|||||||
Args = new List<MethodCallExpressionArgs>() {
|
Args = new List<MethodCallExpressionArgs>() {
|
||||||
new MethodCallExpressionArgs(){
|
new MethodCallExpressionArgs(){
|
||||||
IsMember=true,
|
IsMember=true,
|
||||||
MemberName= formatBuilder.FormatValue(value)
|
MemberName= formatBuilder.FormatValue(UtilMethods.DateOnlyToDateTime(value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1976,6 +1976,8 @@ namespace SqlSugar
|
|||||||
|
|
||||||
internal static object DateOnlyToDateTime(object value)
|
internal static object DateOnlyToDateTime(object value)
|
||||||
{
|
{
|
||||||
|
if (value is DateTime)
|
||||||
|
return value;
|
||||||
if (value == null) return null;
|
if (value == null) return null;
|
||||||
var method = value.GetType().GetMethods().First(it => it.GetParameters().Length == 0 && it.Name == "ToShortDateString");
|
var method = value.GetType().GetMethods().First(it => it.GetParameters().Length == 0 && it.Name == "ToShortDateString");
|
||||||
return method.Invoke(value, new object[] { });
|
return method.Invoke(value, new object[] { });
|
||||||
|
|||||||
Reference in New Issue
Block a user