In C#, using .NET Framework 4, is there an elegant way to repeat the same action a determined number of times? For example, instead of:
int repeat = 10; for
Enumerable.Repeat(() => { Console.WriteLine("Hello World"); this.DoSomething(); },10).ToList().ForEach(f => f.Invoke());
elegant isn't it?