我把该守则撤回到这里的基本内容,但我要说的是,要显示我们等待的用户,然后打电话,而任务等到5秒钟才完成,我然后想再说另一种看法,表明用户的任务已经完成了下面的一些例子,加上一些评论。
public class Test : Controller
{
public IActionResult Index()
{
// Show the User they are Waiting by returning a view with a label telling them
return View("Waiting");
// Then I want to call BeginTask and once its async operation is completed
// Once beginTask is completed I want to show a different view telling the user the task is completed
}
public IActionResult Waiting()
{
return View();
}
public async Task BeginTask()
{
await Task.Delay(5000);
}
public IActionResult Completed()
{
return View();
}
}