I have an I/O bound method that I want to run asynchronously.
In the help docs it mentions that I should use async and await without Task.Run
to quote
For I/O-bound code, you await an operation which returns a Task or Task inside of an async method.
How do I do this from a winforms button click event?
I have tried
private void button_Click(object sender, EventArgs e)
{
await doLoadJob();
}
private async Task<int> doLoadJob()
{
await loadJob();
return 0;
}