Code inspection: Use preferred namespace body style
Starting from C# 10, you can use file-scoped namespace declarations in files containing a single namespace.
If you prefer to stick to either file-scoped or block-scoped namespace declarations, ReSharper lets you configure your preferences and maintain the consistency of your preferences throughout your codebase.
For example, if you prefer having file-scoped namespaces, ReSharper suggests the quick-fix To file-scoped namespace if there is a single namespace declaration in a file.
using System;
namespace MyNamespace
{
class MyClass
{
}
}
namespace MyNamespace;
using System;
class MyClass
{
}
Last modified: 08 April 2024