From 81f8172a56b2c6d125afa515641ff7992c7cde5e Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 27 Dec 2023 12:03:13 +0800 Subject: [PATCH] Update DateOnly --- Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs index 041a7bebe..752839958 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs @@ -539,6 +539,10 @@ namespace SqlSugar { addValue = Convert.ToInt64(addValue); } + else if (item.PropertyType.FullName == "System.DateOnly") + { + addValue = Convert.ToDateTime(addValue).ToString("yyyy-MM-dd"); + } result.Add(name, addValue); } }