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

[MS.DI] Support the ISupportRequiredService.GetRequiredService #330

Closed
dadhi opened this issue Oct 11, 2020 · 2 comments
Closed

[MS.DI] Support the ISupportRequiredService.GetRequiredService #330

dadhi opened this issue Oct 11, 2020 · 2 comments
Assignees
Labels
documentation enhancement New feature or request
Milestone

Comments

@dadhi
Copy link
Owner

dadhi commented Oct 11, 2020

Related to the #180

@dadhi dadhi added this to the MS.DI-v5.0.0 milestone Oct 11, 2020
@dadhi dadhi self-assigned this Oct 11, 2020
@dadhi dadhi added the enhancement New feature or request label Oct 11, 2020
@dadhi
Copy link
Owner Author

dadhi commented Oct 12, 2020

There is no a non-complex way to add this method compared to the value it provides.
To partly mitigate its absence and add the DryIoc rich error messages back I have added the new rule Rules.WithServiceProviderGetServiceShouldThrowIfUnresolved is added (#331).

Option 1 - composition

Implement the DryIocServiceProvider wrapping the IResolver
But the IResolver itself implements the IServiceProvider, so I am afraid to mess things up.

Option 2 - inheritance

Inherit the new container type from the Container and implement the ISupportRequiredService.

  • Un-sealing the Container seems a non-breaking change
  • There is also to need to overload With(...) method to keep the new container type when applying the rules
  • I expect the confusion for what type of pre-configured container to create and pass to the DryIocServiceProviderFactory,

@dadhi dadhi removed their assignment Oct 12, 2020
@dadhi dadhi removed this from the MS.DI-v5.0.0 milestone Oct 12, 2020
@dadhi dadhi self-assigned this Mar 18, 2022
@dadhi dadhi added this to the v5.0.0 milestone Mar 18, 2022
@dadhi dadhi closed this as completed Mar 18, 2022
@dadhi
Copy link
Owner Author

dadhi commented Mar 18, 2022

fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant