This is an oversimplified example, but what, if any, benefit is there to using the first example. I see it happening in a lot of places in some projects I inherited. I don't understand the reasoning behind using a thread to execute something if I'm just going to wait for it to finish.
private async void ButtonClicked(object sender, EventArgs args)
{
await Task.Run(()=>{DoSomething();});
DoSomethingElse();
}
and this
private void ButtonClicked(object sender, EventArgs args)
{
DoSomething();
DoSomethingElse();
}
`