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