Why can't I use/cast an Action for/to a ThreadStart?
- by Rookian
Both are delegates and have the same signature, but I can not use Action as ThreadStart.
Why?
Action doIt;
doIt = () => MyMethod("test");
Thread t;
t = new Thread(doIt);
t.Start();
but this seams to work:
Thread t;
t = new Thread(() => MyMethod("test"));
t.Start();