C#

C#

By DeepSource

Result of a pure method is unused CS-W1068

Bug risk
Autofix

A pure method is a method that does not change an object's state and purely computes and returns a value. Invoking the same method with same arguments repeatedly is guaranteed to return the same result. Such a method's return value should not be ignored. It is likely that this was unintentional.

Examples

Bad Practice

SomePureMethod();

Recommended

var value = somePureMethod();

Reference