ServiceCollectionExtensions.cs should not use the core namespace #4410
Replies: 2 comments 2 replies
-
I remember the guidelines saying that DI extension methods should be in that exact namespace :) Anyway, that ship has sailed. |
Beta Was this translation helpful? Give feedback.
2 replies
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It's generally considered bad practice to use namespaces within the core framework library when defining new types or extension methods. This is because there is a risk the framework introduces a type, interface, etc. of the same name causing a conflict with the custom library. The namespace in ServiceCollectionExtensions.cs should be changed to avoid using the Microsoft.Extensions.DependencyInjection namespace. I'm pretty sure there's a MS document that discusses this but I'm having difficulty locating it at the moment.
Beta Was this translation helpful? Give feedback.
All reactions