Please tell me, what is the difference between these two methods? Both of whether they will run async
? And what will be done in the stream that comes after the words await
?
public async Task<ActionResult> RunAsync()
{
var client = new WebClient();
await client.DownloadDataAsync(someUri);
return _jsonDataResult;
}
and
public async Task<ActionResult> RunAsync()
{
var client = new WebClient();
await Task.Run(()=>
{
client.DownloadData(someUri);
});
return _jsonDataResult;
}
Does it make sense to use 2nd method?