WebContextExtensions¶
Extension methods that decide whether a context carries data and that produce diagnostic text from a request for framework logging.
Purpose¶
- Detect whether a context has content, which gates saving (BR-BOLMIDDLEWARE-003).
- Build log text for troubleshooting context problems.
Context¶
- Namespace:
BolMiddleware.Services.Context - Assembly/package:
BolMiddleware
Public members¶
| Member | Signature | Purpose |
|---|---|---|
HasContent |
static bool HasContent(this ContextHelper helper) |
True when the helper holds any policy, claim, or related value. |
HasContent |
static bool HasContent(this ContextResult result) |
True when the result has content; it also assigns a new GUID id when the session id is present. |
GetFrameworkLoggingInfo |
static string GetFrameworkLoggingInfo(this ContextHelper helper) |
Summarizes the helper values for a log entry. |
GetFrameworkLoggingInfo |
static string GetFrameworkLoggingInfo(this HttpRequest request) |
Summarizes form values, query values, and the referer for a log entry. |
Behavioral notes¶
- The request overload logs submitted values, which can include personal data.
- The
ContextResultoverload mutates the result by setting an id.
Constraints and usage notes¶
- Review logging output before enabling it in production; see Security and authorization.
Sources¶
- src/BolMiddleware/Services/Context/WebContextExtensions.cs