---
title: WebContextExtensions
summary: API reference for WebContextExtensions.
status: draft
owner: SAIF IT Core Services
last_reviewed: 2026-10-12
library: BolMiddleware
reference_type: package
---

# 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](../../business-rules.md#br-bolmiddleware-003-context-content-detection)).
- 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 `ContextResult` overload mutates the result by setting an id.

## Constraints and usage notes
- Review logging output before enabling it in production; see [Security and authorization](../../security-authorization.md).

## Sources
- src/BolMiddleware/Services/Context/WebContextExtensions.cs
