ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Parentheses are redundant if attribute has no arguments

Last modified: 08 April 2024

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. ReSharper suggests removing empty parentheses to make code more concise.