A namespace organizes .NET types under a qualified name. A using directive lets a file refer to types from a namespace without repeating the full name. section 2.4
In C#, namespaces help organize types and resolve their names:
- Dots in a namespace name express a hierarchy: Regex belongs to System.Text.RegularExpressions. section 2.4
- A namespace does not have to share its name with the NuGet package or assembly that provides its types. section 2.4
- Top-level statements are outside a namespace; a separate class can be declared within one and called from the program. section 2.4
Listing 2.6 AsciiArt class using Figgle library to write text and type name
using Figgle;
namespace HelloDotnet; #1
public static class AsciiArt #2
{
public static void Write(string text)
{
Console.WriteLine(FiggleFonts.Standard.Render(text));
Console.WriteLine("Brought to you by "
+ typeof(AsciiArt).FullName); #3
}
}
This example declares AsciiArt in HelloDotnet, uses Figgle, and prints the class’s full name. section 2.4



















