Skip to content

Instantly share code, notes, and snippets.

@kungfux
Created August 6, 2018 10:37
Show Gist options
  • Select an option

  • Save kungfux/e1418353d175645d33929d52ad87aa1c to your computer and use it in GitHub Desktop.

Select an option

Save kungfux/e1418353d175645d33929d52ad87aa1c to your computer and use it in GitHub Desktop.
Namespace Alias
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