I have the following List definition:
class ListItem
{
public int accountNumber { get; set; }
public Guid locationGuid { get; set; }
public DateTime createdon { get; set; }
}
class Program
{
static void Main(string[] args)
{
List<ListItem> entitiesList = new List<ListItem>();
// Some code to fill the entitiesList
}
}
There are duplicates in the accountNumbers of the entitiesList. I want to find the duplicate accountNumbers, do an action on the locationGuids with a createdon date that is not the most recent createdon date of the duplicates. How can I manipulate the list to get only for the duplicates the accountNumber, most recently created locationGuid and the (older) locationGuids?