QueryDesigner
QueryDesigner copied to clipboard
Example of Any
Hi Vladislav,
Can you give me an example of the Any
operator?
I'd like to filter on a few items, with id 1,2,3.
I'm trying with:
new TreeFilter
{
Field = "Id",
FilterType = WhereFilterType.Any,
Value = new List
But I get as a result: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable`1 source) at ShareIt.Web.Common.QueryFilter.Expressions.WhereExpression.GenerateExpressionOneField(Expression prop, WhereFilter filter) in D:\ProjectsGit\ShareIt.Web\ShareIt.Web.Common.QueryFilter\Expressions\WhereExpression.cs at ShareIt.Web.Common.QueryFilter.Expressions.WhereExpression.GetExpressionForField(Expression e, WhereFilter filter, String suffix) in D:\ProjectsGit\ShareIt.Web\ShareIt.Web.Common.QueryFilter\Expressions\WhereExpression.cs
In the piece of code: case WhereFilterType.Any: if (IsEnumerable(prop)) prop = AsQueryable(prop); var ca = CollectionAny.MakeGenericMethod( prop.Type.GenericTypeArguments.First()); return Expression.Call(ca, prop);
Any idea?
regards, Bas.