I know a little about async and await in c#. But I saw this method of returning the view as shown. So I would like to know how this method works?
I have done this,
public async Task<PartialViewResult> SamplePartialPage()
{
ViewBag.countryList = await db.CountryList.ToListAsync();
return PartialView();
}
but not this.
public async Task<PartialViewResult> SamplePartialPage()
{
ViewBag.countryList = await db.CountryList.ToListAsync();
return await Task.Run(() => PartialView());
}