CreatedAtActionResult Class

An Microsoft.AspNetCore.Mvc.ActionResult that returns a Created (201) response with a Location header.

Namespace
Microsoft.AspNetCore.Mvc
Assemblies
  • Microsoft.AspNetCore.Mvc.Core

Syntax

public class CreatedAtActionResult : ObjectResult, IActionResult
class Microsoft.AspNetCore.Mvc.CreatedAtActionResult

Constructors

CreatedAtActionResult(System.String, System.String, System.Object, System.Object)

Initializes a new instance of the Microsoft.AspNetCore.Mvc.CreatedAtActionResult with the values provided.

Arguments:
  • actionName (System.String) – The name of the action to use for generating the URL.
  • controllerName (System.String) – The name of the controller to use for generating the URL.
  • routeValues (System.Object) – The route data to use for generating the URL.
  • value (System.Object) – The value to format in the entity body.
public CreatedAtActionResult(string actionName, string controllerName, object routeValues, object value)

Properties

Microsoft.AspNetCore.Mvc.CreatedAtActionResult.ActionName

Gets or sets the name of the action to use for generating the URL.

Return type:System.String
public string ActionName { get; set; }
Microsoft.AspNetCore.Mvc.CreatedAtActionResult.ControllerName

Gets or sets the name of the controller to use for generating the URL.

Return type:System.String
public string ControllerName { get; set; }
Microsoft.AspNetCore.Mvc.CreatedAtActionResult.RouteValues

Gets or sets the route data to use for generating the URL.

Return type:Microsoft.AspNetCore.Routing.RouteValueDictionary
public RouteValueDictionary RouteValues { get; set; }
Microsoft.AspNetCore.Mvc.CreatedAtActionResult.UrlHelper

Gets or sets the Microsoft.AspNetCore.Mvc.IUrlHelper used to generate URLs.

Return type:Microsoft.AspNetCore.Mvc.IUrlHelper
public IUrlHelper UrlHelper { get; set; }

Methods

OnFormatting(Microsoft.AspNetCore.Mvc.ActionContext)
public override void OnFormatting(ActionContext context)