private static Action <IDocumentProjectionBuilder> ExcludeInvocation(FuncSelectQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node) { // exclude(property1, property2, property3, ...) --> p.Exclude(property1).Exclude(property2).Exclude(property3). ... var properties = node.Arguments.Select(i => i.AsIdentifierName()).ToArray(); return(p => properties.Aggregate(p, (current, property) => current.Exclude(property))); }
private static Action <IDocumentProjectionBuilder> TextScoreInvocation(FuncSelectQuerySyntaxVisitor visitor, InvocationQuerySyntaxNode node) { // textScore(property) --> p.IncludeTextScore(property) var property = (node.Arguments.Count > 0) ? node.Arguments[0].AsIdentifierName() : QuerySyntaxHelper.TextScoreMethodName; return(p => p.IncludeTextScore(property)); }
public static Action <IDocumentProjectionBuilder> CreateSelectExpression(InvocationQuerySyntaxNode node) { var visitor = new FuncSelectQuerySyntaxVisitor(); var selectBody = visitor.Visit(node); return(selectBody); }
private Action <IDocumentProjectionBuilder> BuildSelect(IHttpRequest request) { var selectMethods = ParseSelect(request); var selectMethod = selectMethods?.FirstOrDefault(); if (selectMethod != null) { return(FuncSelectQuerySyntaxVisitor.CreateSelectExpression(selectMethod)); } return(null); }