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: Explicit delegate creation expression is redundant

Last modified: 08 April 2024

Redundant delegate constructor calls may occur, for example, as a result of adding event handlers:

Below, the type of a delegate variable ValueChanged can be inferred from its declaration. To make code shorter, ReSharper suggests removing a redundant explicit delegate’s constructor call: