예제 #1
0
        public async Task <IActionResult> GetMedicines()
        {
            GetMedicinesRequest request = new GetMedicinesRequest();
            var response = await _medicineService.GetMedicinesAsync(request);

            return(GenerateResponse(response));
        }
예제 #2
0
        public async Task <GetMedicinesResponse> GetMedicinesAsync(GetMedicinesRequest request)
        {
            var response = new GetMedicinesResponse();
            var list     = await _medicineRepository.GetMedicinesAsync();

            response.Medicines = list.Select(x => _medicineMapper.ToModel(x)).ToList();
            return(response);
        }