c# foreach linq list code example Example: linq foreach c# someValues.ToList().ForEach(x => list.Add(x + 1));