public void Captured() { var x = new object(); ValueStore store = new ValueStore(); Action action = () => store.SetValue(x); Func <Object> f = () => store.GetValue(); //Implicitly capture closure: x }
public void Captured() { var x = new object(); ValueStore store = new ValueStore(); Action action = () => store.SetValue(x); Func <Object> f = () => store.GetValue(); //Implicitly capture closure: x }