title: LINQ - filtering a result set and joining the result set
body: <p>I have User Table and each user can have multiple Computers... Lets say I am Ram, I can have only one <code>DomainId</code>, multiple <code>UserId</code> and multiple Computers..</p>
  
  <p>I would like to get the <code>DeviceId</code> of all my computers and those should be only Laptops not Desktops</p>
  
  <p>I am getting all the computers details of a given user</p>
  
  <pre><code>var res = (from b in DB.Users
            WHERE b.DomainId == 'MS\\aram'
  select new {b.UserId, b.DeviceId}).ToList();
  </code></pre>
  
  <p>From the above deivces I want to get only those devices which are laptops... The device Id should be present in laptops table</p>
  
  <p>My <code>tblLaptops</code> table is having a column called <code>DeviceId</code>.. I tried in the below query but it is throwing error <strong>cannot convert int into anonymous type</strong></p>
  
  <pre><code>var devices = (from a in LBDB.tblLaptops where res.contains(a.DeviceId)
               select new {a.UserId, a.DeviceId }).ToList();
  </code></pre>
  
  <p>once the above is returned I also want to get <code>Display Name</code> of users which is in Extended Users table</p>
  
  <p>Regarding the DisplayName, the column name is DisplayName and the table Name is ExtendedUser .. The ExtenderUserDevice table has DeviceId column which can be used to compare and the DisplayName of the device...</p>