LINQ Distinct Query

前端 未结 4 1204
余生分开走
余生分开走 2021-01-14 23:23

I have a C# application that loads a List of CLR objects called \"Tasks\". Each Task has the following properties:

public int ID { get; set; }
public int Typ         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-15 00:21

     var uniqueTasks = allTasks.Select(t=>t.TypeName).Distinct().ToList();
    

提交回复
热议问题