Wie kann ich diese Abfrage von SQL in Linq konvertieren?
SELECT status As 'Status',
count(status) As 'Count'
FROM tbl_repair_order
WHERE contract = 'con' and
(status = 'Parts Arr' or
status = 'NA' or
status = 'New Call' or
status = 'Parts Ord' or
status = 'Parts Req' or
status = 'F Work')
GROUP BY status
Update
Danke, Leute, das ist der Code, den ich verwendet habe. Getestet und gibt das gleiche wie oben:
List<string> statuses = new List<string> { "Parts Arr", "NA", "New Call", "Parts Ord", "Parts Req", "F Work"};
var result = (from x in db.tbl_repair_orders
where x.CONTRACT == strContract
&& statuses.Contains(x.STATUS)
group x.STATUS by x.STATUS into grouping
select new { Status = grouping.Key, Count = grouping.Count() });
return result;