예제 #1
0
        public IDoctorForResponse Delete(int id)
        {
            IDoctor doctor = m_Repository.Delete(id);

            return(doctor == null
                       ? null
                       : new DoctorForResponse(doctor));
        }
예제 #2
0
        public ActionResult <Doctor> DeleteDoctor(decimal doctorId)
        {
            var doctor = _repository.GetByID(doctorId);

            if (doctor == null)
            {
                return(NotFound(NotFoundEmptyJsonResult));
            }

            try
            {
                _repository.Delete(doctor);
                _repository.Save();
            }
            catch (DbUpdateException e)
            {
                return(StatusCode(500, InternalServerErrorJsonResult(e.Message)));
            }

            return(doctor);
        }
 public IActionResult OnGet(int id)
 {
     Doctors = _doctorsRepository.GetById(id);
     _doctorsRepository.Delete(Doctors);
     return(RedirectToPage("./Doctores"));
 }