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 })); }
public async Task <IEnumerable <Dto.Medication> > GetAll() { var modelResult = await medicationRepository.GetAllAsync().ConfigureAwait(false); return(modelResult.Select(x => x.ToDto())); }