mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 16:18:47 +08:00
Db.Storageable WhereColumn enum bug
This commit is contained in:
parent
d0f11b34ce
commit
4cd5febece
@ -178,12 +178,20 @@ namespace OrmTest
|
|||||||
Db.Insertable(new UnitEnumTest() { type = null }).ExecuteCommand();
|
Db.Insertable(new UnitEnumTest() { type = null }).ExecuteCommand();
|
||||||
Db.Insertable(new UnitEnumTest() { type = DbType.MySql }).ExecuteCommand();
|
Db.Insertable(new UnitEnumTest() { type = DbType.MySql }).ExecuteCommand();
|
||||||
var xx = Db.Queryable<UnitEnumTest>().ToList();
|
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
|
public class UnitEnumTest
|
||||||
{
|
{
|
||||||
[SqlSugar.SugarColumn(IsNullable =true)]
|
[SqlSugar.SugarColumn(IsNullable =true)]
|
||||||
public DbType? type { get; set; }
|
public DbType? type { get; set; }
|
||||||
|
[SqlSugar.SugarColumn(IsNullable = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Dat_WorkBill
|
public class Dat_WorkBill
|
||||||
|
@ -203,6 +203,10 @@ namespace SqlSugar
|
|||||||
foreach (var item in whereColumns)
|
foreach (var item in whereColumns)
|
||||||
{
|
{
|
||||||
var value = item.PropertyInfo.GetValue(dataItem.Item, null);
|
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()
|
condition.ConditionalList.Add(new KeyValuePair<WhereType, ConditionalModel>(i==0?WhereType.Or :WhereType.And, new ConditionalModel()
|
||||||
{
|
{
|
||||||
FieldName = item.DbColumnName,
|
FieldName = item.DbColumnName,
|
||||||
|
Loading…
Reference in New Issue
Block a user