public IActionResult Delete(int volunteerId) { Volunteer deletedVolunteer = repository.DeleteVolunteer(volunteerId); if (deletedVolunteer != null) { TempData["message"] = $"{deletedVolunteer.LastName} was deleted"; } return(RedirectToAction("Index")); }
public void DeleteVolunteer(VolunteerDTO dto) { try { log.Debug(VolunteerDTO.FormatVolunteerDTO(dto)); R_Volunteer t = VolunteerDTO.ConvertDTOtoEntity(dto); // delete Repository.DeleteVolunteer(t); dto.IsDeleted = t.IsDeleted; log.Debug("result: 'success'"); } catch (System.Exception e) { // error log.Error(e.ToString()); throw; } }
public IActionResult DeleteVolunteer(int id) { _volunteerRepository.DeleteVolunteer(id); return(RedirectToAction("VolunteerList")); }