title: The method 'Where' cannot follow the method 'Select' or is not supported
body: <p>Why am I getting: </p>
  
  <blockquote>
    <p>The method 'Where' cannot follow the method 'Select' or is not
    supported. Try writing the query in terms of supported methods or call
    the 'AsEnumerable' or 'ToList' method before calling unsupported
    methods.</p>
  </blockquote>
  
  <p>...when using the WHERE clause, like when calling:</p>
  
  <pre><code>XrmServiceContext.CreateQuery&lt;Contact&gt;().Project().To&lt;Person&gt;().Where(p =&gt; p.FirstName == "John").First();
  </code></pre>
  
  <p>?</p>
  
  <p>This works:</p>
  
  <pre><code>XrmServiceContext.CreateQuery&lt;Contact&gt;().Project().To&lt;Person&gt;().First();
  </code></pre>
  
  <p>Also this works:</p>
  
  <pre><code>XrmServiceContext.CreateQuery&lt;Contact&gt;().Where(p =&gt; p.FirstName == "John").First();
  </code></pre>
  
  <p>I'm using <a href="https://stackoverflow.com/a/12365931/1133338">AutoMapper QueryableExtension</a>.</p>
  
  <p>Additional info: </p>
  
  <ul>
  <li>I don't want to call ToList() before the Where clause. I know it will works that way.</li>
  <li><code>CreateQuery&lt;TEntity&gt;()</code> returns <code>IQueryable&lt;TEntity&gt;</code>.</li>
  </ul>