public async Task <IEnumerable <DiagnosisGroup> > GetDiagnosisGroups(DiagnosisClass diagnosisClass) { using (HospitalDbContext db = _contextFactory.CreateDbContext()) { IList <DiagnosisGroup> result = await db.DiagnosisGroups .AsQueryable() .Where(d => d.DiagnosisClass == diagnosisClass) .ToListAsync(); return(result); } }
private async Task GetDiagnosisGroups(DiagnosisClass diagnosisClass) { IsLoadingDiagnosis = true; try { DiagnosisGroups.Clear(); var res = await _therapyDataService.GetDiagnosisGroups(diagnosisClass); foreach (DiagnosisGroup group in res) { DiagnosisGroups.Add(group); } } catch (Exception ex) { NotificationManager.AddException(ex, 4); } IsLoadingDiagnosis = false; }