From the course: C# Essential Training 1: Types and Control Flow

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Aliasing namespaces for clarity

Aliasing namespaces for clarity

- [Instructor] I mentioned that one of the purposes of namespaces is so our types don't clash. Let's go over to our LinkedIn essentials types. I'm going to add a new class, going to call it manager.cs, Notice that by default, I get a bunch of using statements up at the top. They all gray out cause we're not using them. And then I get an internal class, so let's make it public called Manager. And it's in the LinkedIn essentials types namespace. Our other manager class over here is in the LinkedIn.essentials namespace. So if I go to program and I say, I want to create a new manager, by default because I have the LinkedIn essentials namespace here, it's perfectly happy. What if I'm also using the LinkedIn essentials types namespace? Now I have a problem because manager isn't clear. Is it the types.manager or is it the essentials.manager? I could fully qualify that. So I could maybe copy this here and I could bring it down and paste it. And now it's clear. Now I've given a fully qualified…

Contents