Ich habe eine Tabelle von Auflistungen (PK = Id). Die Tabelle ein FK zu einem practicticeprofile von PracticeProfileId hat (dh 1 Praxisprofil hat viele Anzeigen)Linq durchschnittliche Anzahl Syntax
Ich mag wouls die durchschnittliche Anzahl der Anzeigen pro Praxis Profil
int count;
count = (from l in myentity.Listings
group l by l.PracticeProfileId into g
select g.Count()).Average();
Ich glaube, ich bin erfolgreich zurück die Objekte von practiceprofile Gruppierung, aber ich bin nicht sicher, wie die durchschnittliche Anzahl der Inserate
dank bekommen
Ich denke, dass Ihr Code korrekt ist. Wenn nicht, könnten Sie Beispieleingabe und erwartetes Ergebnis liefern? –