Closed khellang closed 5 years ago
This issue was moved to aspnet/Home#2327
Sorry I was a bad bot. Re-opening this PR.
Where are the overloads that take a factory? Why only implementation type?
services.AddSingleton<IFoo, Foo1>();
services.Replace<IFoo>(sp => new Foo2());
What's the behavior when you replace an implementation but there are many descriptors that exists for:
services.AddSingleton<IFoo, Foo1>();
services.AddSingleton<IFoo, Foo2>();
services.Replace<IFoo, Foo3>();
Where are the overloads that take a factory? Why only implementation type?
Good point. I've only ever needed the overloads taking a type. I can add the factory overloads if you think they'd be valuable.
What's the behavior when you replace an implementation but there are many descriptors that exists for:
In that case, you'd end up with two registrations of IFoo
, both resolving Foo3
as a singleton 🤔
We're closing this PR because no updates have been provided in a timely manner and we are unable to merge it.
We thank you for the contribution and look forward to collaborating more in the future.
I exposed
TryGetDescriptors
as well. It's a method that I've found useful a number of times. Let me know if you want to make it private instead.Closes https://github.com/aspnet/Home/issues/2328