Db.Storageable WhereColumn enum bug

This commit is contained in:
sunkaixuna 2021-08-21 00:27:13 +08:00
parent d0f11b34ce
commit 4cd5febece
2 changed files with 12 additions and 0 deletions

View File

@ -178,12 +178,20 @@ namespace OrmTest
Db.Insertable(new UnitEnumTest() { type = null }).ExecuteCommand();
Db.Insertable(new UnitEnumTest() { type = DbType.MySql }).ExecuteCommand();
var xx = Db.Queryable<UnitEnumTest>().ToList();
var xxx= Db.Storageable(new UnitEnumTest()
{
Name = "a",
type=DbType.Sqlite
}).WhereColumns(it => it.type).ToStorage();
xxx.AsUpdateable.ExecuteCommand();
}
public class UnitEnumTest
{
[SqlSugar.SugarColumn(IsNullable =true)]
public DbType? type { get; set; }
[SqlSugar.SugarColumn(IsNullable = true)]
public string Name { get; set; }
}
public class Dat_WorkBill

View File

@ -203,6 +203,10 @@ namespace SqlSugar
foreach (var item in whereColumns)
{
var value = item.PropertyInfo.GetValue(dataItem.Item, null);
if (value != null&&value.GetType().IsEnum())
{
value = Convert.ToInt64(value);
}
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(i==0?WhereType.Or :WhereType.And, new ConditionalModel()
{
FieldName = item.DbColumnName,