Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue 2206 (Register should specify Reuse.Transient explicitly.) #2207

Merged
merged 3 commits into from
Oct 6, 2020

Conversation

ryoasai
Copy link
Contributor

@ryoasai ryoasai commented Oct 6, 2020

Description of Change

Describe your changes here.

Bugs Fixed

The current DryIoc adapter doesn't specify transient reuse scope parameters for registering type, and if containers default reuse rule is changed other than Transient, it doesn't correctly implement the target interfaces contracts.

Also automatic resolution of concrete type is also affected by container default reuse settings.
This is a fix for #2206

API Changes

None

Behavioral Changes

After this fix, the containerRegistry.Register call should register type as transient irrespective of the container's default reuse setting. Also. default automatic concrete type resolution always use transient, so any non registered type such as view models are always resolved as transient object.

Note that only with this fix, you can use DryIoc's MefAttribute extension out of the box as it will change the default reuse setting to Singleton.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

@dnfadmin
Copy link

dnfadmin commented Oct 6, 2020

CLA assistant check
All CLA requirements met.

Copy link
Member

@dansiegel dansiegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great! Thanks for the PR @ryoasai

@dansiegel dansiegel merged commit be743c2 into PrismLibrary:master Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] DryIocContainerExtension.Register should specify Reuse.Transient explicitly.
3 participants