No LINQ query with GroupBy method
public class ReportDto { public DateTime Date { get; set; } public WordDto[] Words { get; set; } } ReportDto[] qwe = this.context.TestResults .Where(r => r.Word.Vocabulary.VocabularyID == id) .GroupBy(r => r.Date) .Select(r => new ReportDto { Date = r.Key, Words = r.Select(re => new WordDto { ID = re.WordID.ToString(), Original = re.Word.Original, Translate = re.Word.Translation, Result = re.Result }).ToArray() }).ToArray(); Mistake:
Additional information: LINQ to Entities doesn’t recognize the Core.Dto.WordDto [] ToArrayWordDto method.
.AsEnumerable()after.GroupBy(r => r.Date). - PetSerAl pm