Ich habe folgende zwei Tabellen:
1.) Articles - [ArticleID]
2.) ArticleComments - [CommentID], [ArticleID]
Ich möchte die ArticleID mit der maximalen Anzahl von Kommentaren abrufen, z.B.
ArticleID - 2
TotalNoOfComments - 15
Wie mache ich das in Entity Framework?
Ich greife auf die ArticleComments-Sammlung wie folgt zu: article.ArticleComments. Das folgende wird das Objekt sein, das das Ergebnis speichert.
public class CommentStats
{
public int ContextId { get; set; }
public int CommentCount { get; set; }
}