private CollectionResourceQueryModel GenerateQueryModel(Expression expression)
        {
            // Transform
            var transformedExpression = ApplyTransformations(expression);

            // Discover
            var discoveringVisitor = new DiscoveringExpressionVisitor();
            discoveringVisitor.Visit(transformedExpression);

            // Compile
            var compilingVisitor = new CompilingExpressionVisitor();
            compilingVisitor.Visit(discoveringVisitor.Expressions);
            var compiledModel = compilingVisitor.Model;

            // Validate
            var validator = new QueryModelValidator(compiledModel);
            validator.Validate();

            return compiledModel;
        }
예제 #2
0
        private CollectionResourceQueryModel GenerateQueryModel(Expression expression)
        {
            // Transform
            var transformedExpression = ApplyTransformations(expression);

            // Discover
            var discoveringVisitor = new DiscoveringExpressionVisitor();

            discoveringVisitor.Visit(transformedExpression);

            // Compile
            var compilingVisitor = new CompilingExpressionVisitor();

            compilingVisitor.Visit(discoveringVisitor.Expressions);
            var compiledModel = compilingVisitor.Model;

            // Validate
            var validator = new QueryModelValidator(compiledModel);

            validator.Validate();

            return(compiledModel);
        }