ICollection.Contains on custom types

后端 未结 4 793
旧时难觅i
旧时难觅i 2021-01-12 02:19

If I have a (reference - does it matter?) type MyType which does not override the Equals method, what heuristics will be used when determining if an IC

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-12 03:07

    AFAIK, the reference (address in memory) will be compared...

    If the reference is not good enough for you then you might compare the ID, as you've mentioned.

提交回复
热议问题