Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixing IServiceProvider.GetService implementation (fixes #376) #377

Merged
merged 2 commits into from
Apr 17, 2022

Conversation

lord-executor
Copy link
Contributor

The problem is described in #376 and the solution is straight forward. I have added two test cases for the StandardKernel to ensure that the IServiceProvider implementation is compliant with the behavior defined in the documentation.

@dadhi
Copy link

dadhi commented Oct 25, 2020

@lord-executor Hi and sorry for introdung.
The change seems to be a breaking change.
Maybe it is better to intruduce the config option to enable the proper behavior, and then in the next major version make the breaking change?

@lord-executor
Copy link
Contributor Author

@dadhi intrude away my friend ;) - I call it collaboration

It's true, it does seem a bit breaking and I'll gladly add a configuration option to toggle old / new behavior. But the simple fact is: the current implementation is incorrect, so I would propose to make the correct behavior the default and reverting back an optional configuration.

@codecov-io
Copy link

codecov-io commented Oct 25, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@a46aa70). Click here to learn what that means.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #377   +/-   ##
=========================================
  Coverage          ?   86.80%           
=========================================
  Files             ?       92           
  Lines             ?     2523           
  Branches          ?        0           
=========================================
  Hits              ?     2190           
  Misses            ?      274           
  Partials          ?       59           
Impacted Files Coverage Δ
src/Ninject/ReadOnlyKernel.cs 93.89% <0.00%> (ø)
src/Ninject/NinjectSettings.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a46aa70...cf5f423. Read the comment docs.

@dadhi
Copy link

dadhi commented Oct 25, 2020

I would propose to make the correct behavior the default and reverting back an optional configuration

That's a nice solution.

@scott-xu scott-xu merged commit 1178d7f into ninject:master Apr 17, 2022
@scott-xu
Copy link
Member

Thanks! @lord-executor @dadhi

scott-xu pushed a commit that referenced this pull request Apr 17, 2022
* Fixing IServiceProvider.GetService implementation (fixes #376)

* Added a configuration option to restore the old behavior if necessary
scott-xu pushed a commit that referenced this pull request May 1, 2022
* Fixing IServiceProvider.GetService implementation (fixes #376)

* Added a configuration option to restore the old behavior if necessary
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants