Ejemplo n.º 1
0
        public string DeleteDoctors(DoctorRequest request)
        {
            var delete_doctor = new Doctor
            {
                Id = request.IdDoctor
            };

            _context.Remove(delete_doctor);
            try
            {
                _context.Entry(delete_doctor).State = EntityState.Deleted;
                _context.SaveChanges();
            }
            catch (Exception)
            {
                return(null);
            }
            return("A doctor has been successfully deleted");
        }