What is the difference between calling a Lambda function and explicitly invoking a delegate in Dispatcher? In other words, what is the difference between the following:
Dispatcher.BeginInvoke(new Action( () => Foo() ));
Dispatcher.BeginInvoke((Action)delegate () { Foo(); });
private void Foo() { }
There is no difference. Both lines of code produce the same
MSIL code
(shown for example byILSpy
):