liveBook · Manning

Action result

Also called ActionResult

An action result is the response or outcome produced by an API or MVC action when handling a request.

How 4 Manning books explain it

ASP.NET Core in Action, 3e

ActionResult<T> is an ASP.NET Core MVC result type that allows an action method to return either a typed value or an arbitrary HTTP action result.

How it is used
Uses ActionResult<T> in web API actions that return either typed data or an HTTP action result.
How deep it goes
Explains typed and error returns with controller examples and addresses isolated unit testing without detailing result-type internals.
Examples
Uses a fruit lookup returning a string or NotFound(), and a currency conversion returning a decimal or BadRequest().
What you can do after
Apply ActionResult<T> via ASP.NET Core MVC to return typed data or an appropriate error from a controller action.

Read how ASP.NET Core in Action, 3e explains action result →

Building Web APIs with ASP.NET Core

ActionResult is an ASP.NET Core action return type that can represent either a typed response value or an HTTP action result.

How it is used
Handles successful typed responses and HTTP error results from one ASP.NET Core action.
How deep it goes
Explains the generic return-type change and manual validation branches, stopping short of framework internals.
Examples
Uses the Domains GET action, invalid pageSize and sortOrder queries, and browser Network-tab status inspection.
What you can do after
Apply it via ASP.NET Core MVC to return typed data or structured HTTP errors from one action.

Read how Building Web APIs with ASP.NET Core explains action result →

Pro ASP.NET Core 7, Tenth Edition

An action result is an object representing a response produced by an MVC action method.

How it is used
Represents responses produced by MVC action methods, including rendered views, redirects, and authorization prompts.
How deep it goes
Defines the response abstraction and reuse role, while deferring detailed result types and usage patterns.
Examples
Uses ViewResult, RedirectResult, HttpUnauthorizedResult, and a HomeController action returning a view.
What you can do after
Apply it via MVC action methods to encapsulate reusable HTTP responses.

Read how Pro ASP.NET Core 7, Tenth Edition explains action result →

.NET in Action, Second Edition

ActionResult is an ASP.NET Core result abstraction that represents the outcome of handling a web request, including its response content and HTTP status code.

How it is used
Controls response content and status codes when a minimal API needs more than the default successful response.
How deep it goes
Demonstrates conditional result selection and several built-in response types without detailing their internal implementations.
Examples
Uses ASCII-art content, invalid-font handling, and a JPEG barcode endpoint to demonstrate response choices.
What you can do after
Apply built-in Results methods to return content, not-found responses, and files from minimal API endpoints.

Read how .NET in Action, Second Edition explains action result →

Also covered in

What to know first

Related concepts

Questions about action result

What is action result?

An action result is the response or outcome produced by an API or MVC action when handling a request.

Which Manning books explain action result?

ASP.NET Core in Action, 3e, Building Web APIs with ASP.NET Core, Pro ASP.NET Core 7, Tenth Edition and .NET in Action, Second Edition.

What should I know before learning action result?

Manning books that teach action result usually introduce 400 bad request and model binding first.

What kinds of action result are there?

Kinds of action result include ViewResult.

What is action result a kind of?

Action result is a kind of resource. An API resource is a named, addressable conceptual entity exposed by an interface for access or manipulation.

What is action result also called?

Action result is also called ActionResult.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.