This commit is contained in:
sunkaixuan
2023-07-13 16:05:59 +08:00
parent a311526ebe
commit b49c7020fd

View File

@@ -787,6 +787,12 @@ namespace SqlSugar
var changeValue = UtilMethods.ChangeType2(kv.Value, propertyInfo.PropertyType);
propertyInfo.SetValue(addItem, changeValue);
}
if (kv.Value ==DBNull.Value && UtilMethods.GetUnderType(propertyInfo.PropertyType).IsIn(typeof(int), typeof(long)))
{
var changeValue = UtilMethods.ChangeType2(0, propertyInfo.PropertyType);
propertyInfo.SetValue(addItem, changeValue);
}
else
{
propertyInfo.SetValue(addItem, kv.Value);