Exemplo n.º 1
0
        public async Task <IActionResult> GetTreatments()
        {
            GetTreatmentsRequest request = new GetTreatmentsRequest();
            var response = await _treatmentService.GetTreatmentsAsync(request);

            return(GenerateResponse(response));
        }
Exemplo n.º 2
0
        public async Task <GetTreatmentsResponse> GetTreatmentsAsync(GetTreatmentsRequest request)
        {
            var response = new GetTreatmentsResponse();
            var list     = await _treatmentRepository.GetTreatmentsAsync();

            response.Treatments = list.Select(x => _treatmentMapper.ToModel(x)).ToList();
            return(response);
        }