Table of Contents

Class CreatedODataResult<T>

Namespace
System.Web.Http.OData.Results
Assembly
System.Web.Http.OData.dll

Represents an action result that is a response to a POST operation with an entity to an entity set.

public class CreatedODataResult<T> : IHttpActionResult

Type Parameters

T

The entity type.

Inheritance
CreatedODataResult<T>
Implements
IHttpActionResult
Inherited Members

Constructors

CreatedODataResult(T, IContentNegotiator, HttpRequestMessage, IEnumerable<MediaTypeFormatter>, Uri)

Initializes a new instance of the CreatedODataResult<T> class.

public CreatedODataResult(T entity, IContentNegotiator contentNegotiator, HttpRequestMessage request, IEnumerable<MediaTypeFormatter> formatters, Uri locationHeader)

Parameters

entity T

The created entity.

contentNegotiator IContentNegotiator

The content negotiator to handle content negotiation.

request HttpRequestMessage

The request message which led to this result.

formatters IEnumerable<MediaTypeFormatter>

The formatters to use to negotiate and format the content.

locationHeader Uri

The location header for the created entity.

CreatedODataResult(T, ApiController)

Initializes a new instance of the CreatedODataResult<T> class.

public CreatedODataResult(T entity, ApiController controller)

Parameters

entity T

The created entity.

controller ApiController

The controller from which to obtain the dependencies needed for execution.

Properties

ContentNegotiator

Gets the content negotiator to handle content negotiation.

public IContentNegotiator ContentNegotiator { get; }

Property Value

IContentNegotiator

Entity

Gets the entity that was created.

public T Entity { get; }

Property Value

T

Formatters

Gets the formatters to use to negotiate and format the created entity.

public IEnumerable<MediaTypeFormatter> Formatters { get; }

Property Value

IEnumerable<MediaTypeFormatter>

LocationHeader

Gets the location header of the created entity.

public Uri LocationHeader { get; }

Property Value

Uri

Request

Gets the request message which led to this result.

public HttpRequestMessage Request { get; }

Property Value

HttpRequestMessage

Methods

ExecuteAsync(CancellationToken)

public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

Task<HttpResponseMessage>