public async Task <IEnumerable <MedicineDTO> > Handle(MedicineByNameQuery request, CancellationToken cancellationToken) { IEnumerable <Medicine> medicine = await _medicineRepository.SearchMedicineByName(request.Name); return(this._mapper.Map <IEnumerable <MedicineDTO> >(medicine)); }
public async Task <ActionResult <IEnumerable <MedicineDTO> > > SearchMedicineByName([FromQuery] MedicineByNameQuery searchMedicine) { return(await QueryAsync(searchMedicine)); }