title: No generic method 'OrderBy' on type 'Queryable' is compatible with the supplied type arguments
body: <p>I'm writing some code that will modify an expression so that the subquery contained in it will get ordered.</p>
  
  <p>I found a similar piece of code <a href="https://stackoverflow.com/a/1379693/509464">here on SO</a>, but it's not working for me. I also tried looking at <a href="https://stackoverflow.com/questions/6892605/cant-find-orderby-on-queryable-with-the-supplied-arguments">this</a> answer, but I'm not able to apply this to my piece of code</p>
  
  <blockquote>
    <p>No generic method 'OrderBy' on type 'Queryable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.</p>
  </blockquote>
  
  <pre><code>MethodCallExpression orderByCallExpression = Expression.Call(
      typeof(Queryable),
      "OrderBy"/*Descending*/,
      new Type[] { typeof(TSource), filterpart.OrderOverPropertyGetterValueType },
      navigationalProperty.Body,
      filterpart.OrderOverPropertyGetter);                            
  </code></pre>
  
  <p>I'm trying to figure out which of the 2 type parameters or 2 other arguments is causing this error.</p>
  
  <ul>
  <li><code>OrderOverPropertyGetterValueType</code> is just <code>typeof(DateTime)</code> in this
  case </li>
  <li><code>TSource</code> is an Entity Type (<code>Gifts</code>)</li>
  <li><code>navigationalProperty.Body</code> contains {<code>source.Gifts.AsQueryable()</code>} with expression type: <code>System.Linq.Expressions.MethodCallExpression</code></li>
  <li><code>filterpart.OrderOverPropertyGetter</code> contains <code>{g =&gt; g.Date}</code> with expression type <code>System.Linq.Expressions.Expression&lt;System.Func&lt;Gift,System.DateTime&gt;&gt;</code></li>
  </ul>
  
  <p>I'm clueless how to diagnose which of the four parameters is incorrect. I'm thinking one of the expression types may be incorrect.</p>