Skip to content

Delegate Invoke

Michael Damatov edited this page Sep 10, 2025 · 3 revisions

Show a suggestion when the Invoke method is used on delegate types.

Example

Action action = ... // not null

action.Invoke(); // redundant "Invoke"

action(); // after applying the quick fix

Exceptions

Action action = null

action?.Invoke(); // "Invoke" is not redundant

Tip

A quick fix is available to remove the Invoke method call.

Note

The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.

Clone this wiki locally