Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Model/QueryFilter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Text.Json.Nodes;

namespace Infragistics.QueryBuilder.Executor
namespace Infragistics.QueryBuilder.Executor
{
public class QueryFilter
{
Expand All @@ -11,13 +9,13 @@

public QueryFilterCondition? Condition { get; set; }

public JsonValue? SearchVal { get; set; }
public object? SearchVal { get; set; }

public Query? SearchTree { get; set; }

// And/Or
public FilterType? Operator { get; set; }

public QueryFilter[] FilteringOperands { get; set; }

Check warning on line 19 in Model/QueryFilter.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'FilteringOperands' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
}
}
8 changes: 7 additions & 1 deletion QueryExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,14 @@ private static IEnumerable<dynamic> RunSubquery(DbContext db, Query? query)
return property.GetMemberValue(obj);
}

private static Expression GetSearchValue(JsonValue? jsonVal, Type targetType)
private static Expression GetSearchValue(object? searchValue, Type targetType)
{
if (searchValue == null)
{
return GetEmptyValue(targetType);
}

var jsonVal = JsonValue.Create(searchValue);
var valueKind = jsonVal?.GetValueKind();
if (valueKind == null || valueKind == JsonValueKind.Null || valueKind == JsonValueKind.Undefined)
{
Expand Down
Loading