fix: 修复枚举类型入库操作转为 int

This commit is contained in:
Argo-Tianyi 2022-01-07 12:29:08 +08:00
parent d381ef1e51
commit 88fbd32ee8
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;