Reputation: 11916
How do I convert this into Linq?
SELECT
ps.forename,Count(ps.Forename)
FROM
[Dbase].[dbo].[Absence] ab
INNER JOIN
[Dbase].[dbo].[Person] ps
On
ab.empid=ps.id
where ps.forename='hari'
GROUP BY ps.forename
Having Count(ps.forename)>2
Upvotes: 1
Views: 109
Reputation: 3997
here you go.
var result = (from x in Absence
join y in Person on x.empid equals ps.id
group x by new { z = ps.forename == "hari" } into g
where g.Count() > 2
select new
{
g.Key,
cnt = g.Count()
});
Upvotes: 1