Creating a new object in LINQ query
<p>I have a list of departments. And each department has a list of employees in it. I need to return all employees from this list who were hired after January 15, 2015. But I need to return a list of "Roster" i.e. <code>List&lt;Roster&gt;</code>. I need help with the LINQ query.</p>

<p>Here's my Department class</p>

<pre><code>public class Department
{
   public int DepartmentId { get; set; }
   public string DepartmentName { get; set; }
   public List&lt;Employee&gt; Employees { get; set; } = new List&lt;Employee&gt;();
   public string Location { get; set; }
}
</code></pre>

<p>And my employee class looks like this:</p>

<pre><code>public class Employee
{
   public int EmployeeId { get; set; }
   public Guid PersonId { get; set; }
   public string FirstName { get; set; }
   public string LastName { get; set; }
   public string Gender { get; set; }
   public DateTime DateOfBirth { get; set; }
   public DateTime HireDate { get; set; }
}
</code></pre>

<p>Here's my roster class</p>

<pre><code>public class Roster
{
   public int DepartmentId { get; set; }
   public string DepartmentName { get; set; }
   public string FirstName { get; set; }
   public string LastName { get; set; }
   public string Gender { get; set; }
   public DateTime HireDate { get; set; }
}
</code></pre>

<p>Here's what my query looks like so far:</p>

<pre><code>var employees = departments.Where(x =&gt; x.Employees).Any(o =&gt; o.HireDate &gt;= Convert.ToDateTime("1/15/2015")).Select(i =&gt; new Roster { ??? }).ToList();
</code></pre>

<p>Please keep in mind, I want to return <code>List&lt;Roster&gt;</code> and need to include both department and employee information in the result. I'm not sure how to get some data from Department object and some from Employee to create the Roster class. Thanks.</p>