From 97273d39d675f0ccd781814cfe8a11690acd79c9 Mon Sep 17 00:00:00 2001 From: yangzhinong <66845701@qq.com> Date: Thu, 11 Aug 2022 09:19:17 +0800 Subject: [PATCH] =?UTF-8?q?BugFix:=20=E5=A6=82=E6=9E=9C=E6=98=AF=20int=3F?= =?UTF-8?q?=20=E7=B1=BB=E5=9E=8B,=20=E8=A6=81=E5=88=A4=E6=96=AD=E5=80=BC!?= =?UTF-8?q?=3Dnull=20=E4=B9=8B=E5=90=8E,=20=E6=89=8D=E8=83=BD=E8=B0=83?= =?UTF-8?q?=E7=94=A8ObjToInt=E6=89=A9=E5=B1=95=E6=96=B9=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs index 7b31fc1e8..ebb6abf68 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/ContextMethods.cs @@ -456,9 +456,12 @@ namespace SqlSugar var addItem = readerValues[info]; if (addItem == DBNull.Value) addItem = null; - if (UtilMethods.GetUnderType(prop.PropertyType) == UtilConstants.IntType) + if (prop.PropertyType == UtilConstants.IntType ) { addItem = addItem.ObjToInt(); + } else if (UtilMethods.GetUnderType(prop.PropertyType) == UtilConstants.IntType && addItem != null) + { + addItem= addItem.ObjToInt(); } else if (prop.PropertyType.IsEnum()&&addItem is decimal) {