예제 #1
0
        public DeleteMedicineDTO DeleteMedicine(int id, [FromBody] DeleteMedicineDTO medicine)
        {
            Medicine medicineEntity = _repository.GetMedicineById(id);

            medicine.Id = medicineEntity.Id;
            _mapper.Map(medicine, medicineEntity);
            _repository.DeleteMedicine(medicineEntity);
            _repository.Save();
            return(medicine);
        }
        public async Task <ActionResult <Medicine> > DeleteMedicine(int id)
        {
            IQueryable <Medicine> medicines = (IQueryable <Medicine>)_medicineRepository.DeleteMedicine(id);

            if (medicines.Count() == 0)
            {
                return(NotFound());
            }

            return(Ok(medicines));
        }
 public async Task <bool> DeleteMedicine(int medicineId)
 {
     return(await _medicineRepo.DeleteMedicine(medicineId));
 }
예제 #4
0
 public async Task DeleteMedicine(int id)
 {
     await medicineRepository.DeleteMedicine(id);
 }
 public int DeleteMedicine(int id)
 {
     return(m_MedicineRepository.DeleteMedicine(id));
 }
        public async Task <ActionResult <bool> > DeleteMedicine(int id)
        {
            var result = await _repository.DeleteMedicine(id);

            return(Ok(result));
        }