I need to transform this query into Linq:
select B.Nome
from Gestor A
inner join Entidade B on A.UniaoEntidadeId = b.EntidadeId
group by B.Nome
HAVING COUNT(A.EscolaId) > 0
I need to transform this query into Linq:
select B.Nome
from Gestor A
inner join Entidade B on A.UniaoEntidadeId = b.EntidadeId
group by B.Nome
HAVING COUNT(A.EscolaId) > 0
I can not test, but it should look something like this:
from g in db.Gestor
join e in db.Entidade on g.UniaoEntidadeId equals e.EntidadeId
group g by g.Nome into grpNome
where grpNome.Count() > 0
select grpNome.Key