I want to use Parallel.ForEach as a multi-threading method that executes a code without lists or file reading.
I want to do it like this:
Parallel.ForEach
{
Console.WriteLine("test");
}
So it will write test without stopping. I will use an IF statement to check if it should be stopped or no.
Is it possible to use Parallel.ForEach like that?
Any help would be appreciated.
Thanks!