How do you use LINQ to find the duplicate of a specific property?

前端 未结 3 853
夕颜
夕颜 2021-02-11 19:10
Customer customerOne = new Customer(\"John\", \"Doe\");
Customer customerTwo = new Customer(\"Super\", \"Man\");
Customer customerThree = new Customer(\"Crazy\", \"Guy\"         


        
3条回答
  •  失恋的感觉
    2021-02-11 19:30

        var result = from c in customers
                     join c2 in customers on c.LastName equals c2.LastName
                     where c != c2
                     select c;
    

提交回复
热议问题