Move Type to Another Namespace refactoring
This refactoring helps you move one or more non-nested types to a new or an existing namespace. Namespace declarations are replaced right in the original files and all usages are updated accordingly.
If you need to move a nested type, you can first apply the Move Type to Outer Scope refactoring.
Move one or more types to another namespace
Select types that you want to move in one of the following ways:
In the editor, place the caret at the name of a type.
Select one or several types in the Solution Explorer.
Select one or several types in the Structure window window.
Do one of the following:
Press F6 and then choose Move Type to Another Namespace
Press Ctrl+Alt+Shift+T and then choose Move Type to Another Namespace.
Choose
from the main menu.
The Move Type to Another Namespace dialog will open.
Start typing the name of the target namespace. If you are moving type(s) to an existing namespace, pick it from the drop down list that displays all namespaces matching your input.
To apply the refactoring, click Next.
If no conflicts are found, JetBrains Rider performs the refactoring immediately. Otherwise, it prompts you to resolve conflicts.
![JetBrains Rider. 'Move to another namespace' refactoring JetBrains Rider. 'Move to another namespace' refactoring](https://resources.jetbrains.com.cn/help/img/rider/2024.2/Refactorings__Move__Type_to_Another_Namespace__dialog_box.png)