Entity Framework T-Sql "having" Equivalent
I believe you can use a GroupBy
followed by a Where
clause and it will translate it as a Having
. Not entirely sure though.
Any reason not to just use a where
clause on the result?
var query = from state in states
join stateowner in stateowners
on state.stateid equals stateowner.stateid
group state.Name by state.stateid into grouped
where grouped.Count() > 1
select new { Name = grouped.Key, grouped.Count() };