Skip to content

Commit df43023

Browse files
committed
Addressing more comments
1 parent 1f5e45e commit df43023

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

articles/azure-app-configuration/howto-targetingfilter-aspnet-core.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ A targeting context is required for feature evaluation with targeting. You can p
203203
204204
### Targeting Context Accessor
205205
206-
To provide the targeting context, pass your implementation type of the `ITargetingContextAccessor` to the `WithTargeting<T>` method. If no type is provided, a default implementation is used, as shown in the following code snippet. The default targeting context accessor utilizes `HttpContext.User.Identity.Name` as `UserId` and uses `HttpContext.User.Claims` of type [`Role`](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role?view=net-9.0#system-security-claims-claimtypes-role) for `Groups`. You can reference the [DefaultHttpTargetingContextAccessor](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/src/Microsoft.FeatureManagement.AspNetCore/DefaultHttpTargetingContextAccessor.cs) to implement your own if customization is needed. To learn more about implementing the [ITargetingContextAccessor](./feature-management-dotnet-reference.md#itargetingcontextaccessor), see the feature reference for targeting.
206+
To provide the targeting context, pass your implementation type of the `ITargetingContextAccessor` to the `WithTargeting<T>` method. If no type is provided, a default implementation is used, as shown in the following code snippet. The default targeting context accessor utilizes `HttpContext.User.Identity.Name` as `UserId` and `HttpContext.User.Claims` of type [`Role`](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role?view=net-9.0#system-security-claims-claimtypes-role) for `Groups`. You can reference the [DefaultHttpTargetingContextAccessor](https://github.com/microsoft/FeatureManagement-Dotnet/blob/main/src/Microsoft.FeatureManagement.AspNetCore/DefaultHttpTargetingContextAccessor.cs) to implement your own if customization is needed. To learn more about implementing the [ITargetingContextAccessor](./feature-management-dotnet-reference.md#itargetingcontextaccessor), see the feature reference for targeting.
207207
208208
``` C#
209209
// Existing code in Program.cs
@@ -217,6 +217,9 @@ builder.Services.AddFeatureManagement()
217217
// ... ...
218218
```
219219

220+
> [!NOTE]
221+
> For Blazor applications, see [instructions](./faq.yml#how-to-enable-feature-management-in-blazor-applications-or-as-scoped-services-in--net-applications) for enabling feature management as scoped services.
222+
220223
## Targeting filter in action
221224

222225
1. Build and run the application. Initially, the **Beta** item doesn't appear on the toolbar, because the _Default percentage_ option is set to 0.

0 commit comments

Comments
 (0)