public class Person
{
public string Name {get; set;}
public DateTime Created { get; set; }
}
public class MyData
{
public List
You need to group the Person objects by entire days, so let's do:
var res = Model.Persons.OrderByDescending(p => p.Created)
.GroupBy(p => p.Created.ToShortDateString());
To display them on the console:
foreach(var entry in res)
{
// Day is the same for all items in a group entry.
string groupDay = entry.First().Created.ToShortDateString();
Console.WriteLine(groupDay);
// list all names of persons in that group
foreach(Person p in entry)
{
Console.WriteLine(p.Name);
}
}