RequestHelper¶
Implementation of IRequestHelper constructed by BolContextModel over the current HttpRequest. It prefers form values over query values for the context id.
Purpose¶
- Read the context id (form
WebContextId, otherwise querycid) and session values for context resolution (BR-BOLMIDDLEWARE-001).
Context¶
- Namespace:
BolMiddleware.Services.Request - Assembly/package:
BolMiddleware
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| Constructor | RequestHelper(HttpRequest request) |
Binds the helper to one request. |
GetReferringApplication |
string? GetReferringApplication() |
Reads the referring application value. |
GetContextId |
string? GetContextId() |
Form value first, query value second. |
GetSessionId |
string? GetSessionId() |
Returns the session id. |
GetFormValue |
string? GetFormValue(string key) |
Reads a form value, or null when absent. |
GetContextFromSession |
ContextResult? GetContextFromSession() |
Reads the context from session. |
GetSession |
ISession GetSession() |
Returns the session of the request. |
Behavioral notes¶
- Context ids are accepted without checking who owns them.
Constraints and usage notes¶
- Reading the form on a request without form content may throw.
Sources¶
- src/BolMiddleware/Services/Request/RequestHelper.cs