C# Anonymous Delegate Syntax
/In the effort to save key strokes, sometimes I wonder if C# code is becoming a bit unreadable.
Exhibit Original:
private void VMIsConnected() { Assert.IsTrue(vm.IsConnected); } ... EnqueueCallback(this.VMIsConnected);
Exhibit A:
EnqueueCallback( delegate {
Assert.IsTrue(vm.IsConnected);
} );
Exhibit B:
EnqueueCallback( () => Assert.IsTrue(vm.IsConnected );
Which one do you use?
I like A. Simple enough without extra function signature, yet readable. The ( ) in Exhibit B scares me.