I have just been watching a TekPub video on Lambda's and the code was similar to such:
class Foo{
void DoSomething();
}
static void Bar(Foo item, Action<Foo> action){
return action.Invoke(item);
}
And then within Main:
Bar(new Foo(), x=>x.DoSomething();
My question is, is the Foo object just within scope for that call to Bar? Is the object destroyed once that method has been called?
Thanks.
action.Invoke(Item)inBar?