public static Expression CreateSelectExpression(Type type, InvocationQuerySyntaxNode node) { var visitor = new ExpressionSelectQuerySyntaxVisitor(type); var selectBody = visitor.Visit(node); return(Expression.Lambda(selectBody, visitor.Parameter)); }
private Expression <Func <TDocument, object> > BuildSelect(IHttpRequest request) { var selectMethods = ParseSelect(request); var selectMethod = selectMethods?.FirstOrDefault(); if (selectMethod != null) { return((Expression <Func <TDocument, object> >)ExpressionSelectQuerySyntaxVisitor.CreateSelectExpression(typeof(TDocument), selectMethod)); } return(null); }