Distinct() with lambda?

前端 未结 18 992
南旧
南旧 2020-11-22 06:04

Right, so I have an enumerable and wish to get distinct values from it.

Using System.Linq, there\'s of course an extension method called Distinct<

18条回答
  •  遥遥无期
    2020-11-22 06:44

    I'm assuming you have an IEnumerable, and in your example delegate, you would like c1 and c2 to be referring to two elements in this list?

    I believe you could achieve this with a self join var distinctResults = from c1 in myList join c2 in myList on

提交回复
热议问题