Something worth mentioning is that materializing your request into a list and then repeating it again with "ForEach" can be quite an expensive call if your list is large enough. I would recommend adding the following extension method to give the "ForEach" method for IEnumerable:
public static void Map<T>(this IEnumerable<T> source, Action<T> func)
{
foreach (T i in source)
func(i);
}
I call my card, but you can call it ForEach if you decide so. This turns Danny into:
features.Where(f => fileNames.Any(file => file.Contains(f.FeatureName)))
.Map(x => x.MatchCount = x.MatchCount == 0 ? 1 : x.MatchCount);
source
share