Linq to Sql - Populate JOIN result into a List <p>I am not sure if this can be done, but here's the scenario.</p> <p>I want to turn this sql into linq:</p> <pre><code>SELECT * FROM Department d INNER JOIN Employee e ON e.DepartmentID = d.DepartmentID </code></pre> <p>Department - Employee is 1 to many relationship.</p> <p>I have created a custom object that I would like to populate the result into. </p> <pre><code>public class DepartmentSummary { public Department Department { get; set; } public List&lt;Employee&gt; Employees {get; set;} } </code></pre> <p>The Linq I came up with is </p> <pre><code>var result = from d in dba.Department join e in dba.Employee d.DepartmentID equals e.DepartmentID into j1 select new DepartmentSummary { Department = d, Employees = j1.ToList() }; </code></pre> <p>I tried it out and it's not working. Can anyone shed some light for me please? I would like to perform an inner join between Department and Employee. For each Department in the resultset, I would like to create one DepartmentSummary object which holds that department and a list of employees belonging to that department.</p> <p>Does Linq provides an ad hoc solution for this or must I iterates through the result set and create a list of DepartmentSummary manually?</p> <p>Thanks,</p> <p>EDIT: Looks like this works for me</p> <pre><code>var result = from d in dba.Department join e in dba.Employee d.DepartmentID equals e.DepartmentID into j1 where j1.Count() &gt; 0 select new DepartmentSummary { Department = d, Employees = j1.ToList() }; </code></pre>