allow multiple registrations with Last In First Out #2143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Changes default behavior for DryIoc to retain multiple registrations for a given service. Given the following code:
Prism has always and will continue to expect that when we call
Resolve<IFoo>()
a new instance ofFooB
should be returned by the container.As documented in the original Prism.Container.Extensions issue, a developer may which to resolve
IEnumerable<IFoo>()
such as with Shiny in which Shiny does aResolveAll<T>
to return anIEnumerable<T>
for any delegates that were registered. This change now allows the container to retain each registration to return the IEnumerable with an instance from each registration whenIEnumerable<T>
is resolved, and continue to return the last registration whenT
is resolved.Bugs Fixed
API Changes
None
Behavioral Changes
Given the above code:
PR Checklist