WebContextService¶
Facade over IBolContextApiClient that wraps each call with logging and error handling, so a failure in the BOL Context API does not break the page.
Purpose¶
- Call the BOL Context API to save, get, and create contexts, and log failures (BR-BOLMIDDLEWARE-021).
Context¶
- Namespace:
BolMiddleware.Services.Context - Assembly/package:
BolMiddleware
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| Constructor | WebContextService(IBolContextApiClient client, ISaifLogService logService) |
Receives the API client and logger. |
SaveContext |
bool SaveContext(ContextSaveRequest request) |
Saves through the API and returns false on failure. |
GetContext |
ContextResult GetContext(string contextId) |
Loads by context id. |
GetContext |
ContextResult GetContext(string sessionId, string applicationName) |
Loads by session and application. |
NewContext |
ContextResult NewContext(string sessionId, string applicationName) |
Requests a new context. |
Behavioral notes¶
- Exceptions are logged and not rethrown.
Constraints and usage notes¶
- The client registration for
IBolContextApiClientis duplicated; the last one wins.
Sources¶
- src/BolMiddleware/Services/Context/WebContextService.cs