Remove duplicates while merging lists using Union in LINQ

后端 未结 4 1985
野趣味
野趣味 2021-01-17 13:48

I am trying to merge two lists using list.Union in LinqPad but I can\'t get it to work and wanted to check my understanding is correct.

Giv

4条回答
  •  盖世英雄少女心
    2021-01-17 14:02

    Just want to leave this here for anyone that still couldn't get it. I found this article super helpful about the compare class that inherits from IEqualityComparer http://alicebobandmallory.com/articles/2012/10/18/merge-collections-without-duplicates-in-c

提交回复
热议问题