diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UEnum.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UEnum.cs index 6a9e6bf72..fdd4f04cc 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UEnum.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UEnum.cs @@ -53,6 +53,12 @@ namespace OrmTest type2 = UnitType.b }) .Where(it => true).ExecuteCommand(); + db.Queryable().WhereClass(new Unit00Z1string1() + { + + type = UnitType.a, + type2 = UnitType.b + }).ToList(); } private static void Int() { @@ -74,6 +80,12 @@ namespace OrmTest } Db.Updateable(x3).WhereColumns(it => it.type).ExecuteCommand(); var x4 = Db.Queryable().ToList(); + + Db.Queryable().WhereClass(new Unit00Z11C12() { + + type= UnitType.a, + type2=UnitType.b + }).ToList(); } public class Unit00Z11C12 diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index 66a1223b6..49a8c555c 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -485,6 +485,18 @@ namespace SqlSugar FieldName = column.DbColumnName, FieldValue = value.ObjToString() }); + if (value != null && value.GetType().IsEnum()) + { + if (this.Context.CurrentConnectionConfig?.MoreSettings?.TableEnumIsString == true) + { + + } + else + { + data.Value.FieldValue = Convert.ToInt64(value).ObjToString(); + } + + } cons.ConditionalList.Add(data); if (this.Context.CurrentConnectionConfig.DbType == DbType.PostgreSQL) {