title: Cannot implicitly convert type IEnumerable<T> to IQueryable<T>
body: <p><strong>Obfuscated Scenario</strong>: A person has zero, one or many pets.</p>
  
  <p>Using Linq to Sql, the need is to get an <code>IQueryable</code> list of pets for the given personID. 
  Here's the poorly mangled/butchered/obfuscated portion of the ERD:</p>
  
  <p><img src="https://i.stack.imgur.com/sbEHt.jpg" alt="alt text"></p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code> public IQueryable&lt;Pet&gt; GetPersonPets(int personID)
      {
          var personPets= from p in Person
          where p.ID == somePersonID
          select p.Pets;
  
          return personPets; //fail
          // return (IQueryable&lt;Pet&gt;)personPets  //also fail
          // return personPets.AsQueryable&lt;Pet&gt;()  //also fail
      }
  </code></pre>
  
  <p><strong>Exception Raised:</strong></p>
  
  <pre>
  Cannot implicitly convert type 
  'System.Collections.Generic.IEnumerable (System.Data.Linq.EntitySet(Pet))' 
  to 'System.Linq.IQueryable(Pet)'. 
  An explicit conversion exists (are you missing a cast?) 
  </pre>
  
  <p><strong>Failed Attempts</strong>:</p>
  
  <p>Direct casting didn't work:  <code>(IQueryable&lt;MyType&gt;)</code></p>
  
  <p>Calling collection method <code>AsQueryable</code> didn't work:  <code>.AsQueryable&lt;MyType&gt;()</code></p>
  
  <p><strong>Question</strong>:</p>
  
  <p>How can you cast the results of the LinqToSql query properly to <code>IQueryable</code>?</p>