fix: 修复枚举类型入库操作转为 int
This commit is contained in:
parent
d381ef1e51
commit
88fbd32ee8
|
@ -147,7 +147,7 @@ public static class DatabaseExtensions
|
|||
|
||||
if (v != null)
|
||||
{
|
||||
var val = v.GetType().IsEnum ? v.ToString() : v;
|
||||
var val = v.GetType().IsEnum ? (int)v : v;
|
||||
var operatorExp = GetOperatorExpression(expression);
|
||||
sql.Where($"{db.Provider.EscapeSqlIdentifier(columnName)} {operatorExp} @0", val);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace BootstrapAdmin.Web.Models
|
|||
|
||||
if (Define.HasValue)
|
||||
{
|
||||
ret.Add(new SearchFilterAction(nameof(Dict.Define), Define.Value.ToString(), FilterAction.Equal));
|
||||
ret.Add(new SearchFilterAction(nameof(Dict.Define), Define.Value, FilterAction.Equal));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue