private static MethodInfo ReplaceQueryableMethod(MethodInfo method) { MethodInfo matchingMethod = QueryableTransformer.GetMatchingMethod(method, QueryableTransformer.GetTargetDeclaringType(method)); if (matchingMethod != null) { return(matchingMethod); } throw new InvalidOperationException(string.Format("There is no method {0} on type {1} that matches the specified arguments", method.Name, method.DeclaringType.FullName)); }