How to best implement Equals for custom types?

前端 未结 10 698
春和景丽
春和景丽 2020-11-28 08:41

Say for a Point2 class, and the following Equals:

public override bool Equals ( object obj )

public bool Equals ( Point2 obj )

This is the

10条回答
  •  独厮守ぢ
    2020-11-28 09:24

    There is also a Fody plugin Equals.Fody that generates Equals() and GetHashCode() automatically

提交回复
热议问题