JetBrains Rider
 
2021.3
Get JetBrains Rider
You are viewing the documentation for an earlier version of JetBrains Rider.

Code Inspection: Parentheses are redundant if attribute has no arguments

Last modified: 07 April 2022

Attributes in C# are classes, and they are called by invoking their constructors. If an attribute's constructor has no parameters, C# allows you to specify it without parentheses when you call it. JetBrains Rider suggests removing empty parentheses to make code more concise.