So, I am trying to replicate this SQL query:
select COUNT(*) as Total_2_Review from ( select processed_image_id, count(*) as Total_Confirm from dbo.history where action_id=104 group by processed_image_id having count(*) > 1 ) as tbl
with Linq as follows:
var total2Review = (from h in secondDb.Histories.Where(i => i.ActionId == 104) group h by new { h.ActionId, h.ProcessedImageId } into g where g.Key.ActionId > 1 select g).Count();
However, I know that this should not be correct, because I do not select the actual quantity greater than 1 in the section of my group.
How can I execute this SQL query as a LINQ query?
source share