Réponses:
Comme ça:
from c in db.Company
group c by c.Name into grp
where grp.Count() > 1
select grp.Key
Ou, en utilisant la syntaxe de la méthode:
Company
.GroupBy(c => c.Name)
.Where(grp => grp.Count() > 1)
.Select(grp => grp.Key);
Pour tous ceux qui cherchent à faire cela en vb (comme j'étais et je n'ai rien trouvé)
From c In db.Company
Select c.Name Group By Name Into Group
Where Group.Count > 1
Group By
la Select
clause est après la clause de VB.
La solution ci-dessous peut vous aider.
var unmanagedDownloadcountwithfilter = from count in unmanagedDownloadCount.Where(d =>d.downloaddate >= startDate && d.downloaddate <= endDate)
group count by count.unmanagedassetregistryid into grouped
where grouped.Count() > request.Download
select new
{
UnmanagedAssetRegistryID = grouped.Key,
Count = grouped.Count()
};