Hi,
I have this query below;
select count(status) AS 'NUMBER OF TIMES', CASE WHEN status = 0 THEN 'UNCERTAIN' WHEN status = 1 THEN 'CONFIRM' ELSE 'CANCEL' END AS STATUS from GameConfirmResponses group by status
I wonder if I can add case when to this;
var result = _context.GameBanks
.GroupBy(p => p.Status)
.Select(g => new
{
Count = g.Count(),
Status = g.Key
}).ToList();I tried this but I got syntax error.
Status = g.Key == 0 ? "UNCERTAIN": g.Key == 1 ? "CONFIRM" : g.Key == 1 ? "CANCEL"