I would like to use LINQ's ForEach construct and am not sure how to convert the following.
My current implementation:
var employees = (from e in employeeDepartmentList select e.Employee).ToList();
employeeList = new EmployeeList();
foreach (var emp in employees)
{
employeeList.Add(emp);
}
I am thinking something like this:
employeeList = new EmployeeList();
var employees = (from e in employeeDepartmentList select e.Employee).ToList().ForEach(emp => employeeList.Add(emp));