I would like to get the last 5 values of performance and availability time. To get that I have tried multiple ways, but unfortunately without succes.
I have tried this:
var completeTransactions2 = temp4
.Where(x => x.GroupidAvai == x.GroupidPerf && x.KeyTimeAvai == x.KeyTimePerf)
.GroupBy(x => x.GroupidAvai)
.Select(group => group.OrderByDescending(record => (record.KeyTimeAvai) && (record.KeyTimePerf)).Take(5));
But then I get an error: Operator && cannot be applied to operands of type decimal and decimal.
With that information I have tried something but with result that only one perfTime is being taking the last 5 values and reverse them. Availability is only have one avaitime. This is the query:
var orderedTemp72 = temp4
.Where(x => x.GroupidAvai == x.GroupidPerf)
.GroupBy(x => new { x.GroupidAvai, x.GroupidPerf })
.Select(x => x.OrderByDescending(record => record.KeyTimeAvai)
.ThenByDescending(record => record.KeyTimePerf).Take(5).Reverse());
I hope that someone can put me in the right direction for how solving this. If there are question, please don't hesitate to ask.
Thank you for reading.