Ejemplo n.º 1
0
        public ActionResult DeleteClinic(int id)
        {
            // check if clinic exists
            var clinic = _clinicRepository.GetClinic(id);

            if (clinic != null)
            {
                var deleted = _clinicRepository.DeleteClinic(clinic);

                if (deleted)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(HttpNotFound());
        }
Ejemplo n.º 2
0
        public IActionResult DeleteClinic(int id)
        {
            if (id == 0)
            {
                return(BadRequest());
            }

            var ClinicToDelete = _ClinicRepository.GetClinicById(id);

            if (ClinicToDelete == null)
            {
                return(NotFound());
            }

            _ClinicRepository.DeleteClinic(id);

            return(NoContent());
        }