Table of Contents

Class BrokerControllerBase<TBlocking, TDeferred>

Namespace
OpenServiceBroker
Assembly
OpenServiceBroker.Server.dll

Common base class for Open Service Broker API controllers.

public abstract class BrokerControllerBase<TBlocking, TDeferred> : Controller, IActionFilter, IAsyncActionFilter, IFilterMetadata, IDisposable

Type Parameters

TBlocking

The service type to request from dependency injection for blocking operations.

TDeferred

The service type to request from dependency injection for deferred (asynchronous) operations.

Inheritance
BrokerControllerBase<TBlocking, TDeferred>
Implements
Derived
Inherited Members
Extension Methods

Constructors

BrokerControllerBase(IServiceProvider)

Common base class for Open Service Broker API controllers.

protected BrokerControllerBase(IServiceProvider provider)

Parameters

provider IServiceProvider

Properties

OriginatingIdentity

Describes the identity of the user that initiated a request from the Platform.

protected OriginatingIdentity? OriginatingIdentity { get; }

Property Value

OriginatingIdentity

SupportedApiVersion

The latest Open Service Broker API version currently supported.

public static ApiVersion SupportedApiVersion { get; }

Property Value

ApiVersion

Methods

Do(bool, Func<TBlocking, Task<IActionResult>>, Func<TDeferred, Task<IActionResult>>)

Performs either a blocking or a deferred operation, handling aspects such as API versioning and error serialization.

protected Task<IActionResult> Do(bool acceptsIncomplete, Func<TBlocking, Task<IActionResult>> blocking, Func<TDeferred, Task<IActionResult>> deferred)

Parameters

acceptsIncomplete bool

A value of true indicates that the Platform and its clients support deferred (asynchronous) Service Broker operations. If this parameter is false, and the Service Broker can only handle a request deferred (asynchronously) AsyncRequiredException is thrown.

blocking Func<TBlocking, Task<IActionResult>>

A callback to invoke for blocking operations.

deferred Func<TDeferred, Task<IActionResult>>

A callback to invoke for deferred (asynchronous) operations.

Returns

Task<IActionResult>

Ok()

Creates an OK response with an empty JSON object in the body.

protected OkObjectResult Ok()

Returns

OkObjectResult

SetRetryAfter(TimeSpan)

Sets the Retry-After response header.

protected void SetRetryAfter(TimeSpan retryAfter)

Parameters

retryAfter TimeSpan