Hello,
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 TypeID { get; set; }
public string TypeName { get; set; }
public string Name { get; set; }
I am trying to find the unique types of tasks in this list. I thought I would try to use LINQ to do it. However, I cannot figure out how to do it. How do I say give me all of the unique TypeID and TypeName in this list? Currently I'm trying the following which is getting me no where. In fact, it wound even compile.
var uniqueTasks = allTasks.Distinct(p => p.TypeID);
Thank you,