I have following data structure (simplified): A giant list of the class TestClass
public class TestClass
{
public string Name { get; set; }
public int Value { get; set; }
public DateTime Date { get; set; }
}
I’m trying to find a LINQ-Query to get the number of items with the same Name and Value on one day. I tried it with multiple groupby-Statements but I didn’t get it…
Example:
Name | Value | Date
Alice | 42 | 11.02.1900
Bob | 4211 | 22.03.2030
Bob | 4211 | 22.03.2030
Bob | 42 | 22.03.2030
Bob | 42 | 22.03.2030
Alice | 4711 | 30.01.2045
This data I want to get (Last number is the important one)
Alice, 42, 11.02.1900, 1
Bob, 4211, 22.03.2030, 3
Bob, 42, 22.03.2030, 2
Alice, 4711, 30.01.2045, 1
Thanks for your help!
Regards
You’re looking for