-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Use file-scoped namespaces and implicit usings in tests #26778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also consider adding System.Text
and Xunit
I'd consider adding all non-internal Microsoft.EntityFrameworkCore namespaces. This can also be done at a global level for the entire solution (another good reason why I think Microsoft.Data.Sqlite shouldn't be in the repo, btw). Here's the EFCore.PG setup. |
Which ones are missing? |
Nested ones (e.g. Metadata.Conventions etc.). Also, if we move the implicit usings to the global repo level, we can also put the relational ones in there (Migrations) - unless we think it's important to not have those usings in non-relational projects (I'm not sure I see a problem with that though). |
@roji As far as I can tell, you can't have implicit usings for namespaces that don't exist in the project--the compiler complains that the namespace does not exist. Also, there were problems using them in projects that target .NET Framework TFMs. |
Seems like you're right... That's too bad.
It may be possible to just disable implicit usings at the project level here, but this is moot in any case because of the 1st point... I guess it's per-project then...! |
Added more implicit namespaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐑 🇮🇹
Fixes #26772
Fixes #26773