原始sql:
select EOI_Reach, count(EOI_Reach) from survey where EOI_Category='Valid' group by EOI_Reach
求linq写法,asp.net core 3.0 (mvc)可用
原始sql:
select EOI_Reach, count(EOI_Reach) from survey where EOI_Category='Valid' group by EOI_Reach
求linq写法,asp.net core 3.0 (mvc)可用
var query = (from x in survey
group x by x.EOI_Reach into g
select new { EOI_Reach = g.Key, cnt = g.Count() }).
Where(x => x.EOI_Category == "Valid");