From 330638f5e1d72c8dbf546fc16711456484e2f3a8 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 10 Oct 2017 14:27:40 +0800 Subject: [PATCH] Support Object --- .../Abstract/DbBindProvider/IDataReaderEntityBuilder.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs index 18c6a4ea0..eae7e1e4c 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DbBindProvider/IDataReaderEntityBuilder.cs @@ -128,7 +128,7 @@ namespace SqlSugar } if (propertyInfo != null && propertyInfo.GetSetMethod() != null) { - if (propertyInfo.PropertyType.IsClass() && propertyInfo.PropertyType != UtilConstants.ByteArrayType) + if (propertyInfo.PropertyType.IsClass() && propertyInfo.PropertyType != UtilConstants.ByteArrayType&&propertyInfo.PropertyType!=UtilConstants.ObjType) { BindClass(generator, result, propertyInfo); } @@ -296,6 +296,9 @@ namespace SqlSugar { method = getConvertString; } + if (bindPropertyType == UtilConstants.ObjType) { + method = getValueMethod; + } if (method == null) method = isNullableType ? getOtherNull.MakeGenericMethod(bindPropertyType) : getOther.MakeGenericMethod(bindPropertyType); generator.Emit(OpCodes.Call, method);