Inheritance: ExpressionVisitor
        protected override Expression VisitMethodCall(MethodCallExpression methodCallExpr)
        {
            foreach (var argument in methodCallExpr.Arguments.OfType <MethodCallExpression>())
            {
                VisitMethodCall(argument);
            }

            if (methodCallExpr.Method.DeclaringType == typeof(Queryable))
            {
                if (!_hasQueryParameters)
                {
                    _sb.Append("?");
                    _hasQueryParameters = true;
                }
                else
                {
                    _sb.Append("&");
                }

                if (methodCallExpr.Method.Name == "Where")
                {
                    _sb.Append("where=");
                    Visit(methodCallExpr.Arguments[0]);
                    LambdaExpression lambda = (LambdaExpression)StripQuotes(methodCallExpr.Arguments[1]);
                    Visit(lambda.Body);
                    return(methodCallExpr);
                }
                else if (methodCallExpr.Method.Name == "Select")
                {
                    LambdaExpression lambda = (LambdaExpression)StripQuotes(methodCallExpr.Arguments[1]);
                    _projector = lambda;
                    SDataPropertyProjection projection = new SDataPropertyProjector()
                                                         .ProjectProperties(lambda.Body);
                    _sb.Append("select=");
                    _sb.Append(projection.Properties);
                    return(methodCallExpr);
                }
            }
            throw new NotSupportedException(string.Format("The method '{0}' is not supported", methodCallExpr.Method.Name));
        }
        protected override Expression VisitMethodCall(MethodCallExpression methodCallExpr)
        {
            foreach (var argument in methodCallExpr.Arguments.OfType<MethodCallExpression>())
            {
                VisitMethodCall(argument);
            }

            if (methodCallExpr.Method.DeclaringType == typeof(Queryable))
            {
                if (!_hasQueryParameters)
                {
                    _sb.Append("?");
                    _hasQueryParameters = true;
                }
                else
                    _sb.Append("&");

                if (methodCallExpr.Method.Name == "Where")
                {
                    _sb.Append("where=");
                    Visit(methodCallExpr.Arguments[0]);
                    LambdaExpression lambda = (LambdaExpression) StripQuotes(methodCallExpr.Arguments[1]);
                    Visit(lambda.Body);
                    return methodCallExpr;
                }
                else if (methodCallExpr.Method.Name == "Select")
                {
                    LambdaExpression lambda = (LambdaExpression)StripQuotes(methodCallExpr.Arguments[1]);
                    _projector = lambda;
                    SDataPropertyProjection projection = new SDataPropertyProjector()
                        .ProjectProperties(lambda.Body);
                    _sb.Append("select=");
                    _sb.Append(projection.Properties);
                    return methodCallExpr;
                }
            }
            throw new NotSupportedException(string.Format("The method '{0}' is not supported", methodCallExpr.Method.Name));
        }