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
TBlockingThe service type to request from dependency injection for blocking operations.
TDeferredThe 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
providerIServiceProvider
Properties
OriginatingIdentity
Describes the identity of the user that initiated a request from the Platform.
protected OriginatingIdentity? OriginatingIdentity { get; }
Property Value
SupportedApiVersion
The latest Open Service Broker API version currently supported.
public static ApiVersion SupportedApiVersion { get; }
Property Value
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
acceptsIncompleteboolA 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.
blockingFunc<TBlocking, Task<IActionResult>>A callback to invoke for blocking operations.
deferredFunc<TDeferred, Task<IActionResult>>A callback to invoke for deferred (asynchronous) operations.
Returns
Ok()
Creates an OK response with an empty JSON object in the body.
protected OkObjectResult Ok()
Returns
SetRetryAfter(TimeSpan)
Sets the Retry-After response header.
protected void SetRetryAfter(TimeSpan retryAfter)
Parameters
retryAfterTimeSpan