// GET: Vacancies/Delete/5 public ActionResult Delete(int id) { var vacancy = _repo.FindById(id); if (vacancy == null) { return(NotFound()); } var isSucess = _repo.Delete(vacancy); if (!isSucess) { return(BadRequest()); } return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Delete(int id) { var thisVacancy = await _repo.Get(id); if (thisVacancy == null) { return(BadRequest("Vacancy not found")); } _repo.Delete(thisVacancy); if (await _repo.SaveAll()) { return(NoContent()); } return(BadRequest("Delete unsuccessful")); }
public IActionResult DeleteVacancy(int id) { vacancyRepository.Delete(id); return(RedirectToAction("Vacancies", "Home")); }
public VacancyDto Delete(Int32 vacancyId) { return(VacancyDto.Create(_vacancyRepository.Delete(vacancyId))); }
public void Delete(int id) { vacancyRepository.Delete(id); }
public async Task <ActionResult> Delete(int id) { await _repository.Delete(id); return(NoContent()); }