Skip to content

Commit 2ed2ee8

Browse files
change search value type to object
1 parent 9eb0b69 commit 2ed2ee8

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Model/QueryFilter.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System.Text.Json.Nodes;
2-
3-
namespace Infragistics.QueryBuilder.Executor
1+
namespace Infragistics.QueryBuilder.Executor
42
{
53
public class QueryFilter
64
{
@@ -11,7 +9,7 @@ public class QueryFilter
119

1210
public QueryFilterCondition? Condition { get; set; }
1311

14-
public JsonValue? SearchVal { get; set; }
12+
public object? SearchVal { get; set; }
1513

1614
public Query? SearchTree { get; set; }
1715

QueryExecutor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,14 @@ private static IEnumerable<dynamic> RunSubquery(DbContext db, Query? query)
257257
return property.GetMemberValue(obj);
258258
}
259259

260-
private static Expression GetSearchValue(JsonValue? jsonVal, Type targetType)
260+
private static Expression GetSearchValue(object? searchValue, Type targetType)
261261
{
262+
if (searchValue == null)
263+
{
264+
return GetEmptyValue(targetType);
265+
}
266+
267+
var jsonVal = JsonValue.Create(searchValue);
262268
var valueKind = jsonVal?.GetValueKind();
263269
if (valueKind == null || valueKind == JsonValueKind.Null || valueKind == JsonValueKind.Undefined)
264270
{

0 commit comments

Comments
 (0)