Possible Duplicate:
very simple delegate musing
I’ve been wondering what’s the difference between this method of defining a delegate
System.Action act;
act = MethodWithoutParameters;
and this one
System.Action act;
act = new System.Action(MethodWithoutParameters);
. Should I prefer one over the other? If so, why?
I have unfortunately not been able to find much information regarding my question.
I’d really appreciate it if someone could tell me the differences between those two pieces of code.
It’s syntactic sugar: an “implicit method group conversion”. The compiler transforms the first version into the second.