SyntaxFix
Write A Post
Hire A Developer
Questions
Try this:
foreach (var dept in employees.SelectMany(e => e.Departments)) { dept.SomeProperty = null; collection.Add(dept); }