コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: TherapyViewModel.cs プロジェクト: AdvanGit/repos
        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;
        }