public ActionResult Delete(int?id, AppointmentViewModel appointmentViewModel) { var appointment = _repository.SelectByID(id.Value); var newAppointment = Mapper.Map(appointmentViewModel, appointment); _repository.Delete(newAppointment); _repository.Save(); return(RedirectToAction("Index")); }