How to cancel all threads
I am adding a button in linqpad with an onclick action, like this
controls.Add(new Button("Customers", onClick: async btn => await StartClientAsync("Customers")));
when I click the button it runs fine and ends successfully but I get the message in Linqpad that I need to click CTRL-SHIFT F5 to cancel all threads.
I don't understand which thread is running, is there a way to stop all the threads in Code?
before I click the button there are no threads running.
I am using c# program , the main method is not async as I have no await.