/// <summary>
        /// Visits a method call expression tree node.
        /// </summary>
        /// <param name="node">Node to visit.</param>
        /// <returns>Result of visiting the node.</returns>
        protected internal virtual ExpressionSlim VisitMethodCall(MethodCallExpressionSlim node)
        {
            var @object   = Visit(node.Object);
            var arguments = VisitArguments(node);

            if (@object != node.Object || arguments != null)
            {
                return(node.Rewrite(@object, arguments));
            }

            return(node);
        }
Beispiel #2
0
        protected internal override ExpressionSlim VisitMethodCall(MethodCallExpressionSlim node)
        {
            Append("Call(");
            Append(node.Method);
            VisitNonNull(", ", node.Object);
            if (node.ArgumentCount > 0)
            {
                Append(", ");
                Visit(", ", node);
            }
            Append(')');

            return(node);
        }
        /// <summary>
        /// Visits a method call expression slim tree node, produces a method call expression.
        /// </summary>
        /// <param name="node">Node to visit.</param>
        /// <param name="object">Object operand.</param>
        /// <param name="arguments">Argument expressions.</param>
        /// <returns>The method call expression represented by the expression slim node.</returns>
        protected override Expression MakeMethodCall(MethodCallExpressionSlim node, Expression @object, ReadOnlyCollection <Expression> arguments)
        {
            var method = MakeMethod(node.Method);

            return(_factory.Call(@object, method, arguments));
        }