Код: Выделить всё
List listString = new List();
//Do stuff to populate listString
listString = populateList();
foreach(string var in listString)
{
Task.Run(async () => await ProcessVar(var));
}
Код: Выделить всё
List listString = new List();
//Do stuff to populate listString
listString = populateList();
foreach(string var in listString)
{
string varCopy = var;
Task.Run(async () => await ProcessVar(varCopy));
}
Код: Выделить всё
List listCustom = new List();
//Do stuff to populate listCustom
listCustom = populateList();
foreach(CustomClass var in listCustom)
{
Task.Run(async () => await ProcessVar(var));
}
Код: Выделить всё
List listCustom = new List();
//Do stuff to populate listCustom
listCustom = populateList();
foreach(CustomClass var in listCustom)
{
CustomClass varCopy = var;
Task.Run(async () => await ProcessVar(varCopy));
}