Hello,
I have this method :
public void MaxMoneySoldInaHour(List transactions)
{
var answer = transactions.
GroupBy(i => i.TimeWhenSold.Hour).
Select(group => new { Hour = group.Key, Count = group.Sum(i => i.TotalPrice)}).
ToList();
//TransactionCVSParser.WriteOutComeMoney(answer);
}
}
public void MaxMoneySoldInaHour(List
{
var answer = transactions.
GroupBy(i => i.TimeWhenSold.Hour).
Select(group => new { Hour = group.Key, Count = group.Sum(i => i.TotalPrice)}).
ToList();
//TransactionCVSParser.WriteOutComeMoney(answer);
}
}
but I try to find the max of the sum calculated by the select.
How can I make that work ?
Roelof

Jignesh KumarRank #91 · 22.9K reputationPosted Apr 15, 2020, 4:17 AM EDT
Piyush PansuriyaRank #454 · 5.5K reputationPosted Apr 15, 2020, 4:24 AM EDT
Roelof18 reputationPosted Apr 15, 2020, 7:03 AM EDT