Closed monrealis closed 3 years ago
I disagree with this guideline. The equality behavior is domain-specific; the == operation is part of that behavior and should be consistent with Equals
et al. The internals of that operator are an implementation detail which depends on whether the class is an entity or a value object.
Thanks! It is written that implementing IComparable or IEquatable (like String does) would avoid this code smell, as they call it.
https://github.com/vkhorikov/CSharpFunctionalExtensions/blob/98dc557a017c00fb66c4cfb19a5aee6c3b8abc03/CSharpFunctionalExtensions/ValueObject/ValueObject.cs#L143 this violates https://rules.sonarsource.com/csharp/RSPEC-3875. I am not sure whether I agree with SonarQube, but could you give your view?