Now that we have tremendous functionality thanks to LINQ, I'm wondering which syntax is preferable. For example, I found the following method (just thought it was a good example):
foreach (FixtureImageServicesData image in _fixture.Images)
{
if (image.Filename != _selectedFixtureImage.Filename && image.IsPrimary)
{
image.IsPrimary = false;
image.IsChanged = true;
}
}
If we were to convert it to a LINQ approach, it would look like this (not tested):
_fixture.Images.Where(x => x.Filename != _selectedFixtureImage.Filename && x.IsPrimary).ForEach(x => { x.IsPrimary = false; x.IsChanged = true; });
Which would you would rather see and maintain? Is this crazy or genius?