public async Task <IEnumerable <ReportItem> > GetAll() { var results = await _massReconContext.ReportItem.ToListAsync(); results.ForEach(x => { _massReconContext.Entry(x).Reference(y => y.Report).LoadAsync(); }); return(results); }
public async Task <IEnumerable <Report> > GetAll() { var reports = await _massReconContext.Report.ToListAsync(); reports.ForEach(x => { _massReconContext.Entry(x).Collection(y => y.ReportItems).LoadAsync(); }); return(reports); }