Skip to content

Commit ac4a686

Browse files
authored
Add extension call to example (#35555)
1 parent 87253b0 commit ac4a686

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

aspnetcore/blazor/fundamentals/dependency-injection.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,12 @@ public static class CircuitServicesServiceCollectionExtensions
610610
}
611611
```
612612

613+
Call `AddCircuitServicesAccessor` in the app's `Program` file:
614+
615+
```csharp
616+
builder.Services.AddCircuitServicesAccessor();
617+
```
618+
613619
Access the circuit-scoped services by injecting the `CircuitServicesAccessor` where it's needed.
614620

615621
For an example that shows how to access the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> from a <xref:System.Net.Http.DelegatingHandler> set up using <xref:System.Net.Http.IHttpClientFactory>, see <xref:blazor/security/additional-scenarios#access-authenticationstateprovider-in-outgoing-request-middleware>.

0 commit comments

Comments
 (0)