Open ghost opened 7 years ago
A quick workaround (not sure if it covers all cases, haven't tested thoroughly):
ArangoModelVisitor.cs line 165 (method VisitMainFromClause
):
// a.Contains(b.[c])
if(fromClause.FromExpression.NodeType == ExpressionType.Constant
&& queryModel.ResultOperators.Count == 1
&& queryModel.ResultOperators.All(x => x is ContainsResultOperator))
{
var containsResultOperator = queryModel.ResultOperators[0] as ContainsResultOperator;
GetAqlExpression(containsResultOperator.Item, queryModel);
QueryText.AppendFormat(" in ");
GetAqlExpression(fromClause.FromExpression, queryModel);
DontReturn = true;
} else
// == "IGrouping`2" => .Select(g => g.Select(gList => gList.Age)) subquery select
@onder7973 sorry for the delay, Enumerable.Contains
and other c# methods is not support in ArangoQueryable
, i have plan to do so. but i can't say when
I've run recently into an interesting issue. In a scenario, where service layer does not know about underlying Arango client, it can't use AQL methods and thus relies on IQueryable only (returned by ArangoClient.Query). The returned data by ArangoClient is inconsistent and does not reflect IQueryable filter.
Consider the following:
The first query is correctly translated to the following AQL and person is null:
The second one translates to:
and thus returns invalid data (person is not null) as the filter doesn't do anything meaningful.
is this a bug or intended behaviour to force use the AQL.In method?
Thanks