From the course: C# Best Practices for Developers
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Namespaces - C# Tutorial
From the course: C# Best Practices for Developers
Namespaces
- [Instructor] An important part of classes are namespaces. You might have noticed that when you created a project Visual Studio created a namespace around our class. So for example, on the right here, in our solution explorer our project name was prestige.biz. And as you can see on line seven that is exactly what the namespace is called. Namespaces provide a unique address for our class and organize the application classes in a logical hierarchy. And those hierarchies can be somewhat complex and an example is the .net system a namespace. Let's take a look at lines one through five. This hierarchy, by grouping functionality, helps us be able to find what we are looking for easily. So if I were to comment out line one I no longer will have access to our console, but I can type in system to be able to get access to it. So it's a good practice though to avoid this and use namespaces just like we do on line one to minimize redundancy. And when you're not using classes that are in some…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Project setup overview1m 13s
-
Set up the business layer2m 18s
-
Running a unit test3m 13s
-
Class naming conventions and standards5m 2s
-
Field and property naming conventions4m 22s
-
Using constructors3m 9s
-
Unit testing constructors4m 30s
-
Namespaces2m 48s
-
Static classes3m 10s
-
Unit testing static classes4m 20s
-
Using a singleton2m 6s
-
-
-
-
-