How to get distinct value from array of object in C#?

This question already has an answer here:

  • LINQ's Distinct() on a particular property 17 answers

  • storingAll.GroupBy(x=>x.skuID).Select(group=>group.First());
    

    Note that this solution uses no external libraries. Simple group by the first occurrence of skuID.

    Reference: How to get a distinct list from a List of objects?

    链接地址: http://www.djcxy.com/p/51300.html

    上一篇: Linq Distinct()不起作用

    下一篇: 如何从C#中的对象数组中获取不同的值?