Skip to main content

Definition

Assembly: Microsoft.Restier.AspNetCore.dll Namespace: Microsoft.Restier.AspNetCore Inheritance: Microsoft.AspNet.OData.ODataController

Syntax

Microsoft.Restier.AspNetCore.RestierController

Summary

The all-in-one controller class to handle API requests.

Constructors

.ctor

Initializes a new instance of the RestierController class.

Syntax

public RestierController()

Methods

Delete

Handles a DELETE request to delete an entity.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Delete(System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the deletion result.

Get

Handles a GET request to query entities.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Get(System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the response message.

Patch

Handles a PATCH request to partially update an entity.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Patch(Microsoft.AspNet.OData.EdmEntityObject edmEntityObject, System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
edmEntityObjectMicrosoft.AspNet.OData.EdmEntityObjectThe entity object to update.
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the updated result.

Post

Handles a POST request to create an entity.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Post(Microsoft.AspNet.OData.EdmEntityObject edmEntityObject, System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
edmEntityObjectMicrosoft.AspNet.OData.EdmEntityObjectThe entity object to create.
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the creation result.

PostAction

Handles a POST request to an action.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> PostAction(Microsoft.AspNet.OData.ODataActionParameters parameters, System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
parametersMicrosoft.AspNet.OData.ODataActionParametersParameters from action request content.
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the action result.

Put

Handles a PUT request to fully update an entity.

Syntax

public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> Put(Microsoft.AspNet.OData.EdmEntityObject edmEntityObject, System.Threading.CancellationToken cancellationToken)

Parameters

NameTypeDescription
edmEntityObjectMicrosoft.AspNet.OData.EdmEntityObjectThe entity object to update.
cancellationTokenSystem.Threading.CancellationTokenThe cancellation token.

Returns

Type: System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.IActionResult> The task object that contains the updated result.