Is there a way to execute a lambda expression immediately after its definition?
In other words (Invalid C# code):
Sure.
new Action(() => { Console.WriteLine("Hello World"); })();
That should do the trick.