With the following code in a standard Blazor Web Application in program.cs,
builder.Services.AddRazorComponents();The underlying framework will create a cascading parameter for HttpContext, which can be used in your components as such:
[CascadingParameter]HttpContext? HttpContext { get; set; }Separately, you can inject IHttpContextAccessor into your components. In your profram.cs, you'd do something like:
builder.Services.AddHttpContextAccessor();And in your component you'd do something like
@inject IHttpContextAccessor httpCtxAccessorHowever, httpCtxAccessor.HttContext does NOT equal the cascading parameter HttpContext.Apparently, these are very different things, yet the designers of Blazor thought it made sense to refer to both as HttpContext.
Is there a more sensible way to think about (and perhaps name) these items?