diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index 606bd1077..b1a7273d5 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -699,9 +699,16 @@ namespace SqlSugar { addItem = addItem.ObjToInt(); } - else if (prop.PropertyType.IsEnum() && addItem is decimal) + else if (UtilMethods.GetUnderType(prop.PropertyType).IsEnum() && addItem is decimal) { - addItem = Convert.ToInt64(addItem); + if (prop.PropertyType.IsEnum() == false && addItem == null) + { + //Future + } + else + { + addItem = Convert.ToInt64(addItem); + } } result.Add(name, addItem); }