Can we have an easy way of writing namespaces instead of changing it every time #7266
Unanswered
stealthAngel
asked this question in
Q&A
Replies: 2 comments 1 reply
-
This is, IMO, better solved with an editor feature rather than the language itself (which currently has no concept of files or folder structures). I know ReSharper has a quick action to "fix" namespaces in files, and you can even do it across an entire project in one go. Perhaps VS has the same? |
Beta Was this translation helpful? Give feedback.
1 reply
-
As @TahirAhmadov mentioned, VS 2022 can do this. If you move a file to a folder, it should ask you if you want to change the namespace. |
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.
-
Imagine we have this folder structure:
Library
--- Books
--- --- BookModel
The namespace is then
namespace Library.Books.BookModel;
However, if we move it to somewhere else we need to change the namespace again.
Can't we do something like this?
namespace thisfolder;
so that when the file moves to another location the namespace automatically changes internally?
Beta Was this translation helpful? Give feedback.
All reactions