Class CreatedODataResult<T>
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
TThe created entity.
contentNegotiator
IContentNegotiatorThe content negotiator to handle content negotiation.
request
HttpRequestMessageThe request message which led to this result.
formatters
IEnumerable<MediaTypeFormatter>The formatters to use to negotiate and format the content.
locationHeader
UriThe 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
TThe created entity.
controller
ApiControllerThe 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
Methods
ExecuteAsync(CancellationToken)
public virtual Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken