Created
August 6, 2018 10:37
-
-
Save kungfux/e1418353d175645d33929d52ad87aa1c to your computer and use it in GitHub Desktop.
Namespace Alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace PC { | |
| // Define an alias for the nested namespace. | |
| using Project = PC.MyCompany.Project; | |
| class A { | |
| void M() { | |
| // Use the alias | |
| Project.MyClass mc = new Project.MyClass(); | |
| } | |
| } | |
| namespace MyCompany { | |
| namespace Project { | |
| public class MyClass {} | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment