C#

C#

Made by DeepSource

Consider dropping attribute's parenthesis CS-R1101

Anti-pattern
Minor
Autofix

In a method's case, irrespective of whether it take arguments or not, they must have parenthesis. However, this is not the case for attributes. If an attribute does not take parameters, you can safely drop the parenthesis.

Bad Practice

[MyCustomAttribute()] // Takes no parameters
public void Method()
{
    // ...
}

Recommended

[MyCustomAttribute] // Parenthesis dropped
public void Method()
{
    // ...
}