Share via


CreatedAtRoute Class

Definition

An IResult that on execution will write an object to the response with status code Created (201) and Location header. Targets a registered route.

public sealed class CreatedAtRoute : Microsoft.AspNetCore.Http.IResult, Microsoft.AspNetCore.Http.IStatusCodeHttpResult, Microsoft.AspNetCore.Http.Metadata.IEndpointMetadataProvider
type CreatedAtRoute = class
    interface IResult
    interface IEndpointMetadataProvider
    interface IStatusCodeHttpResult
Public NotInheritable Class CreatedAtRoute
Implements IEndpointMetadataProvider, IResult, IStatusCodeHttpResult
Inheritance
CreatedAtRoute
Implements

Properties

RouteName

Gets the name of the route to use for generating the URL.

RouteValues

Gets the route data to use for generating the URL.

StatusCode

Gets the HTTP status code: Status201Created

Methods

ExecuteAsync(HttpContext)

Write an HTTP response reflecting the result.

Explicit Interface Implementations

IEndpointMetadataProvider.PopulateMetadata(MethodInfo, EndpointBuilder)

Populates metadata for the related Endpoint and MethodInfo.

IStatusCodeHttpResult.StatusCode

Applies to