diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs index 1a3db2537..cd75392ad 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableHelper.cs @@ -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);