Get distinct list values

后端 未结 8 864
余生分开走
余生分开走 2020-12-17 17:58

i have a C# application in which i\'d like to get from a List of Project objects , another List which contains distinct objects.

i trie

8条回答
  •  温柔的废话
    2020-12-17 18:34

    Here's an answer from basically the same question that will help.

    Explanation:

    The Distinct() method checks reference equality for reference types. This means it is looking for literally the same object duplicated, not different objects which contain the same values.

    Credits to @Rex M.

提交回复
热议问题