I'm writing an extensions library for C#, and I'm wondering if it's possible to accept code blocks on a method call. Something like below:
foo()
{
var bar = 0;
};
Or something like this would also do:
foo(
{
var bar = 0; //As an argument to the method
});