Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

ControllerBase.CreatedAtAction Method

Definition

Namespace:
Microsoft.AspNetCore.Mvc
Assembly:
Microsoft.AspNetCore.Mvc.Core.dll
Package:
Microsoft.AspNetCore.Mvc.Core v1.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v1.1.0
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.Core v2.0.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.1.0
Package:
Microsoft.AspNetCore.Mvc.Core v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
CreatedAtAction(String, Object)

Creates a CreatedAtActionResult object that produces a Status201Created response.

CreatedAtAction(String, Object, Object)

Creates a CreatedAtActionResult object that produces a Status201Created response.

CreatedAtAction(String, String, Object, Object)

Creates a CreatedAtActionResult object that produces a Status201Created response.

CreatedAtAction(String, Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a CreatedAtActionResult object that produces a Status201Created response.

public:
 virtual Microsoft::AspNetCore::Mvc::CreatedAtActionResult ^ CreatedAtAction(System::String ^ actionName, System::Object ^ value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string actionName, object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string? actionName, object? value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member CreatedAtAction : string * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
override this.CreatedAtAction : string * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
Public Overridable Function CreatedAtAction (actionName As String, value As Object) As CreatedAtActionResult

Parameters

actionName
String

The name of the action to use for generating the URL.

value
Object

The content value to format in the entity body.

Returns

The created CreatedAtActionResult for the response.

Attributes

Applies to

CreatedAtAction(String, Object, Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a CreatedAtActionResult object that produces a Status201Created response.

public:
 virtual Microsoft::AspNetCore::Mvc::CreatedAtActionResult ^ CreatedAtAction(System::String ^ actionName, System::Object ^ routeValues, System::Object ^ value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string actionName, object routeValues, object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string? actionName, object? routeValues, object? value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member CreatedAtAction : string * obj * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
override this.CreatedAtAction : string * obj * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
Public Overridable Function CreatedAtAction (actionName As String, routeValues As Object, value As Object) As CreatedAtActionResult

Parameters

actionName
String

The name of the action to use for generating the URL.

routeValues
Object

The route data to use for generating the URL.

value
Object

The content value to format in the entity body.

Returns

The created CreatedAtActionResult for the response.

Attributes

Applies to

CreatedAtAction(String, String, Object, Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

Creates a CreatedAtActionResult object that produces a Status201Created response.

public:
 virtual Microsoft::AspNetCore::Mvc::CreatedAtActionResult ^ CreatedAtAction(System::String ^ actionName, System::String ^ controllerName, System::Object ^ routeValues, System::Object ^ value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string actionName, string controllerName, object routeValues, object value);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.CreatedAtActionResult CreatedAtAction(string? actionName, string? controllerName, object? routeValues, object? value);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member CreatedAtAction : string * string * obj * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
override this.CreatedAtAction : string * string * obj * obj -> Microsoft.AspNetCore.Mvc.CreatedAtActionResult
Public Overridable Function CreatedAtAction (actionName As String, controllerName As String, routeValues As Object, value As Object) As CreatedAtActionResult

Parameters

actionName
String

The name of the action to use for generating the URL.

controllerName
String

The name of the controller to use for generating the URL.

routeValues
Object

The route data to use for generating the URL.

value
Object

The content value to format in the entity body.

Returns

The created CreatedAtActionResult for the response.

Attributes

Applies to


Feedback

Was this page helpful?