C#

C#

Made by DeepSource

Argument passed to Equals() is same as the object upon which this method is invoked CS-W1086

Bug risk
Critical

Equals() method is used to check if 2 entities are the same. However, in this case, the argument supplied to this method is the same as the object upon which this method is invoked and will always evaluate to true. It is recommended that you fix this issue by passing in an appropriate argument.

Bad Practice

foo.Equals(foo);

Recommended

foo.Equals(bar);