ASP.NET Core MVC — What is IActionResult?

Nawodya Ishan
Jun 18, 2022

The IActionResult type is a based abstraction of an ActionResult.

💡 An ActionResult is a return type of a controller method, also called an action method, and serves as the base class for *Result classes. Action methods return models to views, file streams, redirect to other controllers, or whatever is necessary for the task at hand.

It specifies how a response is going to be given for a Specific Request.

The IActionResult return type is appropriate when multiple action result return types are possible in an action.

The IActionResult is an interface, while action results themselves are abstract classes.

--

--

Nawodya Ishan

Associate Software Engineer at Metaroon Labs | Unity Engine, Full Stack, Blockchain | Former Chairman at IEEE Computer Society SBC of SLTC