Skip to content

Use file-scoped namespaces everywhere in samples - #3708

Merged
roji merged 1 commit into
dotnet:mainfrom
roji:FileScopedNamespaces
Mar 2, 2022
Merged

roji merged 1 commit into
dotnet:mainfrom
roji:FileScopedNamespaces

Conversation

@roji

@roji roji commented Jan 31, 2022

Copy link
Copy Markdown
Member

Done automatically with Rider (and manually removed changes to migration files).

Note that if we have any code snippets in the conceptual pages which don't reference a region, this would break them (since line numbers will now shift). However, we almost always use regions which wouldn't be affected (since line numbers are relative).

@roji
roji requested a review from a team January 31, 2022 09:20
@ErikEJ

ErikEJ commented Jan 31, 2022

Copy link
Copy Markdown
Contributor

Also simple to do automatically with Visual Studio 😉

@ajcvickers

Copy link
Copy Markdown
Contributor

@roji Do we want to do this? Generally, we want code copied from samples to be usable by people who might not be running the latest of everything.

@roji

roji commented Jan 31, 2022 •

Copy link
Copy Markdown
Member Author

I'm thinking that at least EF Core 6.0 users have to use the latest SDK anyway, so they'd have to be manually restricting the language version to pre-10 for this to fail... Am doing some ASP.NET minimal API samples where it would be a shame to have to namespace etc.

But am OK if you prefer we didn't do this.

@ajcvickers ajcvickers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah 🐑 🇮🇹
🐑 🇮🇹 good
🐑 🇮🇹 real good

@roji
roji force-pushed the FileScopedNamespaces branch from a2b61f8 to 3bdd0bf Compare March 2, 2022 10:04
@roji
roji merged commit 12c2a44 into dotnet:main Mar 2, 2022
@roji
roji deleted the FileScopedNamespaces branch March 2, 2022 10:05
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.

3 participants