title: How to retrieve data from multiple tables using Entity Framework
body: <p>I'm new to Entity Framework, and working on Boys &amp; Girls Hostel Application. I decided to develop it as a WCF Service.</p>
  
  <p>I have two tables </p>
  
  <ol>
  <li>Master </li>
  </ol>
  
  <p><strong>Tbl_Room</strong></p>
  
  <ul>
  <li><code>Rm_no int</code> (PK)</li>
  <li><code>Rm_Name varchar</code></li>
  <li><code>RentPerBed money</code></li>
  <li><p><code>SharingLevel int</code> </p>
  
  <ol>
  <li>Child </li>
  </ol></li>
  </ul>
  
  <p><strong>Tbl_Bed</strong></p>
  
  <ul>
  <li><code>Sr_no</code> (PK)</li>
  <li><code>Rm_no int</code> (FK)</li>
  <li><code>Bed_no int</code> </li>
  <li><code>Status int</code></li>
  </ul>
  
  <p>I wrote the following function to retrieve data for the available beds but I'm getting an error ...and I'm confused about how I can do this...</p>
  
  <pre><code>public IEnumerable&lt;Tbl_Room&gt; Available()
  {
      var avilableRoomWithBed = (from r in db.Tbl_Room
                                 join s in db.Tbl_Bed on r.Rm_No equals s.Rm_No
                                 where s.Status == 0
                                 select new Tbl_Room()
                                 {
                                     Rm_No = r.Rm_No,
                                     Rm_Name = r.Rm_Name,
                                     Floar = r.Floar,
                                     RentPerBed = r.RentPerBed
                                 }).ToList();
  
       return avilableRoomWithBed.ToList();
  }
  </code></pre>
  
  <p>Here I want to retrieve <code>Bed_no</code> which have a status of 0 i.e available</p>
  
  <p>I am confused about the return type of <code>IEnumerable</code> and what I have to return</p>