Asp.net mvc 异步和常规MVC之间的差异

Asp.net mvc 异步和常规MVC之间的差异,asp.net-mvc,asp.net-mvc-4,Asp.net Mvc,Asp.net Mvc 4,异步任务和没有异步任务有什么区别?这有区别吗?这和使用jQueryAjax一样吗 [HttpPost] [ValidateAntiForgeryToken] public async Task<ActionResult> SetPassword(SetPasswordViewModel model) { // If we got this far, something failed, redisplay form ret

异步任务和没有异步任务有什么区别?这有区别吗?这和使用jQueryAjax一样吗

   [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<ActionResult> SetPassword(SetPasswordViewModel model)
    {

        // If we got this far, something failed, redisplay form
        return View(model);
    }

异步控制器方法对于长时间运行的方法是有益的。例如,进行昂贵的数据库查询或后端服务调用的方法

它与ajax不同。这将导致控制器方法在新线程中执行,从而释放线程供web服务器处理请求

我知道这不是最好的描述,但你可以在这里找到更多:


最后,它们应该不会有太大区别,因为您缺少wait关键字。所以根本就没有异步。相关的:
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult SetPassword(SetPasswordViewModel model)
    {

        // If we got this far, something failed, redisplay form
        return View(model);
    }