+ In regular ASP.NET web application, the singleton `IHttpContextAccessor` [pattern](https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-targetingfilter-aspnet-core#update-the-web-application-code-to-use-targetingfilter) is used to obtain the targeting context from `HttpContext`. However, this pattern does not work for Blazor server applications, because `HttpContext` is unavailable. [The recommended approach](https://learn.microsoft.com/en-us/aspnet/core/blazor/security/server/interactive-server-side-rendering?view=aspnetcore-7.0#ihttpcontextaccessorhttpcontext-in-razor-components) for passing the information of HttpContext in Blazor apps is to copy the data into a scoped service. Then, the targeting context accessor should consume that scoped service to determine the targeting context. In this case, the API `AddScopedFeatureManagement` should be used instead.
0 commit comments