Esempio n. 1
0
        public async Task <IActionResult> GetAllMedications()
        {
            var data = await _meRepo.GetAllAsync(SD.MedicationAPIPath, HttpContext.Session.GetString("JWToken"));

            IEnumerable <Medication> list = data.ToList();

            if (TempData["residentId"] != null)
            {
                list           = list.Where(x => x.ResidentId.ToString().Equals(TempData["residentId"])).ToList();
                TempData["id"] = TempData["residentId"];
            }
            return(Json(new { data = list }));
        }
Esempio n. 2
0
        public async Task <IEnumerable <Dto.Medication> > GetAll()
        {
            var modelResult = await medicationRepository.GetAllAsync().ConfigureAwait(false);

            return(modelResult.Select(x => x.ToDto()));
        }