This commit is contained in:
sunkaixuan
2017-06-09 18:55:45 +08:00
parent 27734a894c
commit c9424cb49d

View File

@@ -168,6 +168,7 @@ namespace SqlSugar
{ {
case CSharpDataType.@int: case CSharpDataType.@int:
CheckType(bind.IntThrow, bindProperyTypeName, validPropertyName, propertyName); CheckType(bind.IntThrow, bindProperyTypeName, validPropertyName, propertyName);
if (bindProperyTypeName.IsContainsIn("int","int32","int64"))
method = isNullableType ? getConvertInt32 : getInt32; method = isNullableType ? getConvertInt32 : getInt32;
break; break;
case CSharpDataType.@bool: case CSharpDataType.@bool:
@@ -220,7 +221,7 @@ namespace SqlSugar
method = getConvertString; method = getConvertString;
} }
if (method == null) if (method == null)
method = getOtherNull.MakeGenericMethod(bindPropertyType); method =isNullableType? getOtherNull.MakeGenericMethod(bindPropertyType):getOther.MakeGenericMethod(bindPropertyType);
generator.Emit(OpCodes.Call, method); generator.Emit(OpCodes.Call, method);
if (method == getValueMethod) if (method == getValueMethod)
{ {