Sorry if this is obvious. I'm trying to make the jump from VB.NET to C# and I'm currently playing around with tasks. In VB.NET I can define a task like so:
Dim t As New Task(Sub()
Threading.Thread.Sleep(1000)
End Sub)
The part after task makes sense to me, I'm creating a new method.
In C# it looks like:
Task t = new Task(() =>
{
Thread.Sleep(1000);
});
I'm guessing the ()
is stating it's a new method but what is and why do I need =>
.