public static SqlQuerySpec Evaluate(Expression expression)
        {
            switch (expression.NodeType)
            {
            case ExpressionType.Constant:
            {
                return(DocumentQueryEvaluator.HandleEmptyQuery((ConstantExpression)expression));
            }

            case ExpressionType.Call:
            {
                return(DocumentQueryEvaluator.HandleMethodCallExpression((MethodCallExpression)expression));
            }

            default:
                throw new DocumentQueryException(
                          string.Format(CultureInfo.CurrentUICulture,
                                        ClientResources.BadQuery_InvalidExpression,
                                        expression.ToString()));
            }
        }
        public static SqlQuerySpec Evaluate(
            Expression expression,
            CosmosSerializationOptions serializationOptions = null,
            IDictionary <object, string> parameters         = null)
        {
            switch (expression.NodeType)
            {
            case ExpressionType.Constant:
            {
                return(DocumentQueryEvaluator.HandleEmptyQuery((ConstantExpression)expression));
            }

            case ExpressionType.Call:
            {
                return(DocumentQueryEvaluator.HandleMethodCallExpression((MethodCallExpression)expression, parameters, serializationOptions));
            }

            default:
                throw new DocumentQueryException(
                          string.Format(CultureInfo.CurrentUICulture,
                                        ClientResources.BadQuery_InvalidExpression,
                                        expression.ToString()));
            }
        }