VContainer icon indicating copy to clipboard operation
VContainer copied to clipboard

Added option to TryGetSharedInstance to IObjectResolver

Open AlonTalmi opened this issue 1 year ago • 1 comments

Added to IObjectResolver interface a TryGetSharedInstance which only returns if a shared instance of the request type (or Registration) exists and was created.

Can be used to update instances of a type (if they're not transient) at runtime without resolving them needlessly.

I also added generic extension methods and Unit Tests

AlonTalmi avatar Nov 15 '23 10:11 AlonTalmi

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vcontainer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 10:20am

vercel[bot] avatar Nov 15 '23 10:11 vercel[bot]

The use case may not be very clear. Also, I am reluctant to function in a way that could abuse DI. Please let me reject this time. Thanks for your suggestion.

hadashiA avatar Apr 15 '24 03:04 hadashiA