10 Replies
IEquatable
has method .Equals()
that takes a nullable parameter
So just change Equals(Money money)
to Equals(Money? money)
Hey. Thanks for your answer! But Money can't be null whatsoever so how does that help? Sorry if my question is dumb.
IEquatable
requires the method Equals()
to also handle a null
That's all there is to itHmm. Okay. Thank you!
A class implementing an interface must implement it entirely and verbatim
Fair enough. I wasn't exactly familiar with equality implementation and stuff so that's why i asked.
Thanks once again!
Anytime 👌
@GEmanuel Can you share updated code.
Sorry for the late reply. Here you go.
Based on this:
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-define-value-equality-for-a-type
How to define value equality for a class or struct - C# Programming...
Learn how to define value equality for a class or struct. See code examples and view available resources.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.
Was this issue resolved? If so, run /close
- otherwise I will mark this as stale and this post will be archived until there is new activity.