예제 #1
0
        public static Expression CreateSelectExpression(Type type, InvocationQuerySyntaxNode node)
        {
            var visitor    = new ExpressionSelectQuerySyntaxVisitor(type);
            var selectBody = visitor.Visit(node);

            return(Expression.Lambda(selectBody, visitor.Parameter));
        }
예제 #2
0
        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);
        }