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

Use file-scoped namespaces and implicit usings in tests #26778

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

ajcvickers
Copy link
Member

Fixes #26772
Fixes #26773

@ajcvickers ajcvickers requested a review from a team November 21, 2021 21:51
Copy link
Member

@AndriySvyryd AndriySvyryd left a 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

@roji
Copy link
Member

roji commented Nov 22, 2021

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.

@ajcvickers
Copy link
Member Author

I'd consider adding all non-internal Microsoft.EntityFrameworkCore namespaces.

Which ones are missing?

@roji
Copy link
Member

roji commented Nov 22, 2021

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).

@ajcvickers
Copy link
Member Author

@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.

@roji
Copy link
Member

roji commented Nov 22, 2021

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.

Seems like you're right... That's too bad.

Also, there were problems using them in projects that target .NET Framework TFMs.

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...!

@ajcvickers
Copy link
Member Author

Added more implicit namespaces

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

🐑 🇮🇹

@ajcvickers ajcvickers merged commit 197479e into main Nov 22, 2021
@ajcvickers ajcvickers deleted the InspectorFrost1121 branch November 22, 2021 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use implicit usings Use file scoped namespaces
3 participants