Esempio n. 1
0
        private IWhereFragment buildChildCollectionQuery(IQueryableDocument mapping, QueryModel query, Expression valueExpression, string op)
        {
            var members = FindMembers.Determine(query.MainFromClause.FromExpression);
            var field = mapping.FieldFor(members);

            if (query.HasOperator<CountResultOperator>())
            {
                var value = field.GetValue(valueExpression);

                return new WhereFragment($"jsonb_array_length({field.SqlLocator}) {op} ?", value);
            }

            throw new NotSupportedException("Marten does not yet support this type of Linq query against child collections");
        }