Sorry if this has been asked before, but I would like a concise answer on the differences between the following two usages. VS seems to accept both of them as valid code.
private static void doSomeWork()
{
//do some work
}
public someClass()
{
//Thread thread = new Thread(doSomeWork);
//or
//Thread thread = new Thread(new ThreadStart(doSomeWork));
}
The only difference is that the first one doesn’t work in C# 1. The compiler of C# 2 and later, translates the first one into the second one.
Method groups are implicitly convertible to delegate types with a compatible signature. This feature is called “(Implicit) method group conversion”. Sometimes you need the second one to guide overload resolution, but that’s not the case here.