[Feature] Add support for keyed services#1881
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1881 +/- ##
==========================================
+ Coverage 84.62% 84.66% +0.04%
==========================================
Files 309 309
Lines 6818 6836 +18
Branches 1050 1052 +2
==========================================
+ Hits 5770 5788 +18
Misses 839 839
Partials 209 209
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
I just want to say thank you for this. I did not expect this at all :-) |
|
I did not investigate further, but when I update I think it might be caused by this PR. I should mention, this application is still using .NET 6. In .NET 8 I don't see this exception. The way I use the resilience pipeline is something like: // On launch
services.AddResiliencePipeline<string, SomeResult>("someKey", (builder, context) => { /* ... */ });
// Inject into a singleton
class MySingleton
{
public MySingleton(ResiliencePipelineProvider<string> resiliencePipelineProvider) { }
} |
I believe this is related dotnet/runtime#95789 |
Pull Request
The issue or feature being addressed
#1874
Details on the issue fix or feature implementation
This PR adds support for keyed services into Polly.
Confirm the following