You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.
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() {1,2,3}
}
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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() {1,2,3}
}
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.
The text was updated successfully, but these errors were encountered: