title: Selecting records from parent table depending on child table filter
body: <p>This should be simple, but I'm getting confused.</p>
  
  <p>I have a parent/child tables - and all I want to do, is select from the parent table, depending on filtering of the child table.</p>
  
  <p>So the parent table, Rooms, is linked one to many to the clients table - I want to select rooms, where there are no linked records in the Clients table, where the clients.Departure date is before a specific date:</p>
  
  <pre><code>  public class Room
      {
          public int RoomId { get; set; }
          public string RoomName { get; set; }
          public List&lt;Client&gt; Clients { get; set; }
      }
  
    public class Client
      {
          public int ClientId { get; set; }
          public int RoomId { get; set; }
          public string Name { get; set; }
          public DateTime Arrival { get; set; }
          public DateTime Departure { get; set; }
          public Room Room { get; set; }
      }
  </code></pre>
  
  <p>In my controller I have been trying:</p>
  
  <pre><code> public ActionResult Avail()
          {
              DateTime dteFrom = DateTime.Parse("2012-07-01");  //hard coded for testing
              Room room = db.Rooms.Where(r =&gt; r.Clients.Any(c =&gt; c.Departure &lt;= dteFrom));
  </code></pre>
  
  <p>But I get the error message:</p>
  
  <pre><code>Cannot implicitly convert type 'System.Linq.IQueryable&lt;ttp.Models.Room&gt;' to 'ttp.Models.Room'. An explicit conversion exists (are you missing a cast?)
  </code></pre>
  
  <p>Can anyone suggest do I need to change my model classes, or my Where statement?</p>