Table of Contents

Class ODataController

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

Defines a base class for OData controllers that support writing and reading data using the OData formats.

[ODataRouting]
[ODataFormatting]
public abstract class ODataController : ApiController
Inheritance
ODataController
Derived

Constructors

ODataController()

protected ODataController()

Methods

Created<TEntity>(TEntity)

Creates an action result with the specified values that is a response to a POST operation with an entity to an entity set.

protected virtual CreatedODataResult<TEntity> Created<TEntity>(TEntity entity)

Parameters

entity TEntity

The created entity.

Returns

CreatedODataResult<TEntity>

A CreatedODataResult<T> with the specified values.

Type Parameters

TEntity

The created entity type.

Updated<TEntity>(TEntity)

Creates an action result with the specified values that is a response to a PUT, PATCH, or a MERGE operation on an OData entity.

protected virtual UpdatedODataResult<TEntity> Updated<TEntity>(TEntity entity)

Parameters

entity TEntity

The updated entity.

Returns

UpdatedODataResult<TEntity>

An UpdatedODataResult<T> with the specified values.

Type Parameters

TEntity

The updated entity type.