Class WebApiController
Inherit from this class and define your own Web API methods You must RegisterController in the Web API Module to make it active.
Inherited Members
Namespace: EmbedIO.WebApi
Syntax
public abstract class WebApiController
Properties
CancellationToken
Gets the CancellationToken used to cancel processing of the request.
Declaration
public CancellationToken CancellationToken { get; }
Property Value
Type | Description |
---|---|
CancellationToken |
HttpContext
Gets the HTTP context.
This property is automatically initialized upon controller creation.
Declaration
public IHttpContext HttpContext { get; }
Property Value
Type | Description |
---|---|
IHttpContext |
Request
Gets the HTTP request.
Declaration
public IHttpRequest Request { get; }
Property Value
Type | Description |
---|---|
IHttpRequest |
Response
Gets the HTTP response object.
Declaration
public IHttpResponse Response { get; }
Property Value
Type | Description |
---|---|
IHttpResponse |
Route
Gets the resolved route.
This property is automatically initialized upon controller creation.
Declaration
public RouteMatch Route { get; }
Property Value
Type | Description |
---|---|
RouteMatch |
Session
Gets the session proxy associated with the HTTP context.
Declaration
public ISessionProxy Session { get; }
Property Value
Type | Description |
---|---|
ISessionProxy |
User
Gets the user.
Declaration
public IPrincipal? User { get; }
Property Value
Type | Description |
---|---|
Nullable<IPrincipal> |
Methods
OnBeforeHandler()
Called before a handler to perform common operations.
The default behavior is to set response headers in order to prevent caching of the response.
Declaration
protected virtual void OnBeforeHandler()
PreProcessRequest()
This method is meant to be called internally by EmbedIO.
Derived classes can override the OnBeforeHandler() method to perform common operations before any handler gets called.
Declaration
public void PreProcessRequest()