Given below is the sample code.
string[] str = new string[10];
str[0] = "A";
str[1] = "B";
.... and so on.
Parallel.Invoke(() =>
{
foreach(string temp in str)
{
MainFunc(temp);
}
});
I want to invoke the "MainFunc" methods 10 times dynamically. Hence, i used foreach loop for. But, the method is running only one time. Please help. Thanks in advance :)