It's an anonymous delegate. Instead of having to write a separate function, which is what you had to in C# version 1.0:
void MainMethod()
{
bool success = true;
Thread connectThread = new Thread(new ThreadStart(thread_start));
}
void thread_start() {
success = TryConnectingToAnalysisServer(connectionString);
}
With C# 2.0 you can now write this more compactly with a anonymous method:
void MainMethod()
{
bool success = true;
Thread connectThread = new Thread(delegate() {
success = TryConnectingToAnalysisServer(connectionString);
});
}
With C# 3.0 you can write this slightly more compactly using a lambda expression:
void MainMethod()
{
bool success = true;
Thread connectThread = new Thread(() => {
success = TryConnectingToAnalysisServer(connectionString);
});
}