public async Task <IEnumerable <SurgeryOperation> > GetSurgeryOperations(SurgeryGroup surgeryGroup) { using (HospitalDbContext db = _contextFactory.CreateDbContext()) { IList <SurgeryOperation> result = await db.SurgeryOperations .AsQueryable().AsNoTracking() .Where(s => s.SurgeryGroup == surgeryGroup) .Include(s => s.SurgeryGroup) .ToListAsync(); return(result); } }
private async Task GetSurgeryOperations(SurgeryGroup group) { IsLoadingSurgery = true; try { SurgeryOperations.Clear(); var res = await _therapyDataService.GetSurgeryOperations(group); foreach (SurgeryOperation operation in res) { SurgeryOperations.Add(operation); } } catch (Exception ex) { NotificationManager.AddException(ex, 4); } IsLoadingSurgery = false; }