SequenceEqual for specific properties

后端 未结 2 1519
鱼传尺愫
鱼传尺愫 2021-01-21 11:57

I would like to compare two lists of objects. The objects have four different properties. I need to compare only three of them as sequence (only three because one is always diff

2条回答
  •  臣服心动
    2021-01-21 12:35

    You can use the Enumerable.SequenceEqual overload that allows you to specify a custom IEqualityComparer - implement a custom one that only compares the three properties you are interested in.

提交回复
热议问题