Skip to content

Commit

Permalink
FIND-13264: Filter by enumerated properties
Browse files Browse the repository at this point in the history
- Remove incorrect function
  • Loading branch information
ManhOptimizely committed Oct 21, 2024
1 parent 2d343c8 commit a185e42
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 378 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,6 @@ public NumericFilterOperators InRange(int? from, int? to)
}
return this;
}
public NumericFilterOperators InRanges(params (int? from, int? to)[] ranges)
{
foreach (var range in ranges)
{
InRange(range.from, range.to);
}
return this;
}

public NumericFilterOperators Eq(float value)
{
Expand Down Expand Up @@ -164,21 +156,5 @@ public NumericFilterOperators InRange(double? from, double? to)
}
return this;
}
public NumericFilterOperators InRanges(params (float? from, float? to)[] ranges)
{
foreach (var range in ranges)
{
InRange(range.from, range.to);
}
return this;
}
public NumericFilterOperators InRanges(params (double? from, double? to)[] ranges)
{
foreach (var range in ranges)
{
InRange(range.from, range.to);
}
return this;
}
}
}
48 changes: 48 additions & 0 deletions APIs/src/EpiServer.ContentGraph/Api/Querying/TypeQueryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,54 @@ public TypeQueryBuilder<T> Where(Expression<Func<T, IEnumerable<long>>> fieldSel

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, int?>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, IEnumerable<int>>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, float?>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, IEnumerable<float>>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, double?>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, IEnumerable<double>>> fieldSelector, NumericFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
filterOperator.ValidateNotNullArgument("filterOperator");
Where(fieldSelector.GetFieldPath(), filterOperator);

return this;
}
public TypeQueryBuilder<T> Where(Expression<Func<T, string>> fieldSelector, DateFilterOperators filterOperator)
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
Expand Down
Loading

0 comments on commit a185e42

Please sign in to comment.