CreatedResult 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 CreatedResult : ObjectResult, IActionResult
class Microsoft.AspNetCore.Mvc.CreatedResult

Constructors

CreatedResult(System.String, System.Object)

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

Arguments:
  • location (System.String) – The location at which the content has been created.
  • value (System.Object) – The value to format in the entity body.
public CreatedResult(string location, object value)
CreatedResult(System.Uri, System.Object)

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

Arguments:
  • location (System.Uri) – The location at which the content has been created.
  • value (System.Object) – The value to format in the entity body.
public CreatedResult(Uri location, object value)

Properties

Microsoft.AspNetCore.Mvc.CreatedResult.Location

Gets or sets the location at which the content has been created.

Return type:System.String
public string Location { get; set; }

Methods

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