EditorConfig control File-scoped namespace declaration

To control the code style in editorconfig use this line :

To enforce this style

namespace SampleCode
{
    public class MyClass
    {
    }
}

Add this line in .editorconfig

# IDE0160: Convert to block-scoped namespace
csharp_style_namespace_declarations = block_scoped:warning

To enforce this style

namespace SampleCode;

public class MyClass
{
}

Add this line in .editorconfig

# IDE0160: Convert to file-scoped namespace
csharp_style_namespace_declarations = file_scoped:warning

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)