From eb982ddce0866555fbd7902c988ff4ca2c0a5cdf Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:53:37 -0800 Subject: [PATCH] Freshness review: Controller action return types in ASP.NET Core web API (#36811) * Initial plan * Freshness review: fix metadata, double spaces, and internal links in action-return-types articles Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Wade Pickett --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com> Co-authored-by: Meaghan Osagie (Lewis) Co-authored-by: Wade Pickett --- aspnetcore/web-api/action-return-types.md | 13 +++++++------ .../includes/action-return-types7.md | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/aspnetcore/web-api/action-return-types.md b/aspnetcore/web-api/action-return-types.md index f0fe8780d9af..f02eee012328 100644 --- a/aspnetcore/web-api/action-return-types.md +++ b/aspnetcore/web-api/action-return-types.md @@ -1,11 +1,12 @@ --- title: Controller action return types in ASP.NET Core web API +ai-usage: ai-assisted author: tdykstra description: ActionResult vs IActionResult monikerRange: '>= aspnetcore-3.1' ms.author: tdykstra ms.custom: mvc -ms.date: 6/20/2023 +ms.date: 02/26/2026 uid: web-api/action-return-types --- # Controller action return types in ASP.NET Core web API @@ -37,7 +38,7 @@ When multiple return types are possible, it's common to mix an or IAsyncEnumerable\ -See [Return `IEnumerable` or `IAsyncEnumerable`](/aspnet/core/fundamentals/best-practices#return-ienumerablet-or-iasyncenumerablet) for performance considerations. +See [Return `IEnumerable` or `IAsyncEnumerable`](xref:fundamentals/best-practices#return-ienumerablet-or-iasyncenumerablet) for performance considerations. ASP.NET Core buffers the result of actions that return before writing them to the response. Consider declaring the action signature's return type as to guarantee asynchronous iteration. Ultimately, the iteration mode is based on the underlying concrete type being returned and the selected formatter affects how the result is processed: @@ -97,7 +98,7 @@ If the [`[ApiController]`](xref:Microsoft.AspNetCore.Mvc.ApiControllerAttribute) ## ActionResult vs IActionResult -The following section compares `ActionResult` to `IActionResult` +The following section compares `ActionResult` to `IActionResult`. ### ActionResult\ type @@ -144,12 +145,12 @@ In the preceding action: ## HttpResults type -In addition to the MVC-specific built-in result types ( and [ActionResult\](xref:Microsoft.AspNetCore.Mvc.ActionResult%601)), ASP.NET Core includes the [HttpResults](xref:Microsoft.AspNetCore.Http.HttpResults) types that can be used in both [Minimal APIs](/aspnet/core/fundamentals/minimal-apis) and Web API. +In addition to the MVC-specific built-in result types ( and [ActionResult\](xref:Microsoft.AspNetCore.Mvc.ActionResult%601)), ASP.NET Core includes the [HttpResults](xref:Microsoft.AspNetCore.Http.HttpResults) types that can be used in both [Minimal APIs](xref:fundamentals/minimal-apis) and Web API. Different than the MVC-specific result types, the `HttpResults`: * Are a results implementation that is processed by a call to [IResult.ExecuteAsync](xref:Microsoft.AspNetCore.Http.IResult.ExecuteAsync%2A). -* Does ***not*** leverage the configured [Formatters](/aspnet/core/web-api/advanced/formatting#format-specific-action-results). Not leveraging the configured formatters means: +* Does ***not*** leverage the configured [Formatters](xref:web-api/advanced/formatting#format-specific-action-results). Not leveraging the configured formatters means: * Some features like `Content negotiation` aren't available. * The produced `Content-Type` is decided by the `HttpResults` implementation. @@ -160,7 +161,7 @@ The `HttpResults` can be useful when sharing code between Minimal APIs and Web A The namespace contains classes that implement the interface. The `IResult` interface defines a contract that represents the result of an HTTP endpoint. The static [Results]() class is used to create varying `IResult` objects that represent different types of responses. -The [Built-in results](/aspnet/core/fundamentals/minimal-apis#built-in-results) table shows the common result helpers. +The [Built-in results](xref:fundamentals/minimal-apis#built-in-results) table shows the common result helpers. Consider the following code: diff --git a/aspnetcore/web-api/action-return-types/includes/action-return-types7.md b/aspnetcore/web-api/action-return-types/includes/action-return-types7.md index 13afa11e4116..f7e328506fd0 100644 --- a/aspnetcore/web-api/action-return-types/includes/action-return-types7.md +++ b/aspnetcore/web-api/action-return-types/includes/action-return-types7.md @@ -24,7 +24,7 @@ When multiple return types are possible, it's common to mix an or IAsyncEnumerable\ -See [Return `IEnumerable` or `IAsyncEnumerable`](/aspnet/core/fundamentals/best-practices#return-ienumerablet-or-iasyncenumerablet) for performance considerations. +See [Return `IEnumerable` or `IAsyncEnumerable`](xref:fundamentals/best-practices#return-ienumerablet-or-iasyncenumerablet) for performance considerations. ASP.NET Core buffers the result of actions that return before writing them to the response. Consider declaring the action signature's return type as to guarantee asynchronous iteration. Ultimately, the iteration mode is based on the underlying concrete type being returned and the selected formatter affects how the result is processed: @@ -84,7 +84,7 @@ If the [`[ApiController]`](xref:Microsoft.AspNetCore.Mvc.ApiControllerAttribute) ## ActionResult vs IActionResult -The following section compares `ActionResult` to `IActionResult` +The following section compares `ActionResult` to `IActionResult`. ### ActionResult\ type @@ -131,12 +131,12 @@ In the preceding action: ## HttpResults type -In addition to the MVC-specific built-in result types ( and [ActionResult\](xref:Microsoft.AspNetCore.Mvc.ActionResult%601)), ASP.NET Core includes the [HttpResults](xref:Microsoft.AspNetCore.Http.HttpResults) types that can be used in both [Minimal APIs](/aspnet/core/fundamentals/minimal-apis) and Web API. +In addition to the MVC-specific built-in result types ( and [ActionResult\](xref:Microsoft.AspNetCore.Mvc.ActionResult%601)), ASP.NET Core includes the [HttpResults](xref:Microsoft.AspNetCore.Http.HttpResults) types that can be used in both [Minimal APIs](xref:fundamentals/minimal-apis) and Web API. Different than the MVC-specific result types, the `HttpResults`: * Are a results implementation that is processed by a call to [IResult.ExecuteAsync](xref:Microsoft.AspNetCore.Http.IResult.ExecuteAsync%2A). -* Does ***not*** leverage the configured [Formatters](/aspnet/core/web-api/advanced/formatting#format-specific-action-results). Not leveraging the configured formatters means: +* Does ***not*** leverage the configured [Formatters](xref:web-api/advanced/formatting#format-specific-action-results). Not leveraging the configured formatters means: * Some features like `Content negotiation` aren't available. * The produced `Content-Type` is decided by the `HttpResults` implementation. @@ -275,7 +275,7 @@ If the [`[ApiController]`](xref:Microsoft.AspNetCore.Mvc.ApiControllerAttribute) ## ActionResult vs IActionResult -The following section compares `ActionResult` to `IActionResult` +The following section compares `ActionResult` to `IActionResult`. ### ActionResult\ type