SequenceEqual for specific properties

后端 未结 2 1520
鱼传尺愫
鱼传尺愫 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:23

    You could use the SequenceEqual overload that allows you to pass in an IEqualityComparer implementation that only includes the properties that you wish to compare.

    The example on that linked page is a good one.

提交回复
热议问题