Linq to group by two fields and average
问题 I have the following C# models: public class RawData { public int questionnaireId { get; set; } public int coachNodeId { get; set; } public int questionnaireNumber { get; set; } public float score { get; set; } } public class AveragedData { public int coachNodeId { get; set; } public int questionnaireNumber { get; set; } public float averageScore { get; set; } } I have an API endpoint which is returning data from a database, mapped as List<RawData> . The values are like this: questionnaireId