Ejemplo n.º 1
0
        public IActionResult Delete(int id)
        {
            var appointment = _appointmentService.GetById(id);

            if (appointment == null)
            {
                return(NotFound());
            }
            var model = new AppointmentDeleteViewModel()
            {
                Id = appointment.Id,
                AppointmentName = appointment.AppointmentName
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Delete(AppointmentDeleteViewModel model)
        {
            await _appointmentService.Delete(model.Id);

            return(RedirectToAction(nameof(Index)));
        }