private bool TryApplyMethodCall(MethodCallExpression node) { ReadOnlyCollection <Expression> arguments = node.Arguments; if (arguments.Count > 0) { this.Visit(arguments[0]); } MethodInfo genericMethodDefinition = node.GetGenericMethodDefinition(); switch (arguments.Count) { case 1: return(genericMethodDefinition == QueryableMethods.Count || genericMethodDefinition == QueryableMethods.LongCount); case 2: return(this.TryApplyMethodCall(genericMethodDefinition, arguments[1])); default: return(false); } }