Let’s say I have a
public class MyObject
{
public string Property1;
//other properties
//other properties
}
and then I have a
List<MyObject> objectList
Where Property1 has one value for the first few items, another value for the next few items, etc. How can I count the distinct number of MyObjects based on Property1?
Use
GroupBy.http://www.codeproject.com/articles/35667/How-to-Use-LINQ-GroupBy.aspx