What's the point of ActionResult return type?

后端 未结 3 1133
臣服心动
臣服心动 2021-02-01 23:13

What is the point of an action returning ActionResult?

3条回答
  •  梦谈多话
    2021-02-01 23:48

    ActionResult is the base class for many different types of controller results. By returning the base class, the controller action can return different types of results depending on the outcome of the method -- a ViewResult, a RedirectToActionResult, etc. ActionResult contains all of the data needed by the View or new Action that is the result of the current controller action.

提交回复
热议问题