Aspnetcore.docs: Better documentation for scope DI usage with HttpClientFactory scenarios

Created on 3 Nov 2020  Â·  3Comments  Â·  Source: dotnet/AspNetCore.Docs

The IHttpClientFactory creates a separate DI scope for each handler. Handlers can depend upon services of any scope. Services that handlers depend upon are disposed when the handler is disposed.

This statement should be more visible (like a NOTE in yellow in bold). We should also show examples of how scoped services resolved. Show the same scoped service being resolve in an HttpMessageHandler and the request with difference lifetimes. That's bitten some people.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P0 Source - Docs.ms doc-bug

Most helpful comment

@davidfowl requests have the highest priority, much higher that P0 :ghost: :sunglasses: :fire:

All 3 comments

@serpent5 let me know if you're interested in working on this.

@Rick-Anderson Yeah, sure. I'll investigate the specifics and submit something. Do you want me to prioritise this one over the others I've got on my list? I see it's a P0.

@davidfowl requests have the highest priority, much higher that P0 :ghost: :sunglasses: :fire:

Was this page helpful?
0 / 5 - 0 ratings