I am new to Linq.
I want to set two values in foreach statement like this
foreach
My actual code is this
foreach (Employee emp in employees
You can use Array.ForEach()
Array.ForEach()
Array.ForEach(employees, employee => { Array.ForEach(employee.Departments, department => department.SomeProperty = null); Collection.AddRange(employee.Departments); });