File Scoped Namespaces
- Mostly
.cs
files contains code for single namespace - In C# 10, you can include a namespace as a statement, followed by a semi-colon and without the curly brackets
- Only one file-scoped namespace declaration is allowed, and it must come before any types are declared.
Old
namespace SampleNamespace
{
class SampleClass
{
}
}
New
namespace SampleNamespace;
class SampleClass
{
}