I have a list of objects like this:
public class Entity
{
public int Id { get; set; }
public DateTime Date { get; set; }
}
| Id | Date |
| 1 | 2017-01-16 12:58:32 |
| 2 | 2017-01-16 11:36:01 |
| 3 | 2017-01-16 17:55:19 |
| 4 | 2017-01-19 13:19:40 |
| 5 | 2017-01-19 09:21:55 |
And I would like to filter this using LINQ to count the number of ocurrences by day. So the result would be something like this:
| Date | Occurrences |
| 2017-01-16 | 3 |
| 2017-01-17 | 2 |
Is it possible to do this with LINQ?
GroupBy