Please see the code excerpt below, which I found here: https://msdn.microsoft.com/en-us/library/dd537612(v=vs.110).aspx:
static void SimpleContinuation()
{
string path = @"C:\users\public\TPLTestFolder\";
try
{
var firstTask = new Task(() => CopyDataIntoTempFolder(path));
var secondTask = firstTask.ContinueWith((t) => CreateSummaryFile(path));
firstTask.Start();
}
catch (AggregateException e)
{
Console.WriteLine(e.Message);
}
}
I am confused by the Lambda expression:
var secondTask = firstTask.ContinueWith((t) => CreateSummaryFile(path));
What is the purpose of: (t)? and why is it contained in brackets? t is not defined anywhere.
I have read this webpage, however it has not answered my question: https://msdn.microsoft.com/en-us/library/bb397687.aspx
Action<Task>>) but doesn't use it.tis not defined anywhere" It is defined right here.