• copygirl@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    7
    ·
    7 days ago

    Then you should also override Equals(object), GetHashCode, and implement IEquatable<T>.

    Thankfully a lot of the usual boilerplate code can be avoided using a record class or struct:

    public record Person(string Name, uint Age);
    
    • Gonzako@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      6 days ago

      Oh well, It does show how little I do have to actually use that. It just hasn’t come up that much