public async Task <IActionResult> Get([FromBody] GetHeiIptWorkupCommand getHeiIptWorkupCommand) { var response = await _mediator.Send(getHeiIptWorkupCommand, Request.HttpContext.RequestAborted); if (response) { return(Ok(response.Value)); } return(BadRequest(response.Value)); ; }
public async Task <Result <List <PatientIptWorkup> > > Handle(GetHeiIptWorkupCommand request, CancellationToken cancellationToken) { using (_unitOfWork) { try { List <PatientIptWorkup> patientIptWorkup = await _unitOfWork.Repository <PatientIptWorkup>() .Get(x => x.PatientId == request.PatientId && !x.DeleteFlag).ToListAsync(); return(Result <List <PatientIptWorkup> > .Valid(patientIptWorkup)); } catch (Exception e) { Log.Error(e.Message + " " + e.InnerException); return(Result <List <PatientIptWorkup> > .Invalid(e.Message)); } } }