Esempio n. 1
0
        // 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)));
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
 public IActionResult DeleteVacancy(int id)
 {
     vacancyRepository.Delete(id);
     return(RedirectToAction("Vacancies", "Home"));
 }
Esempio n. 4
0
 public VacancyDto Delete(Int32 vacancyId)
 {
     return(VacancyDto.Create(_vacancyRepository.Delete(vacancyId)));
 }
Esempio n. 5
0
 public void Delete(int id)
 {
     vacancyRepository.Delete(id);
 }
        public async Task <ActionResult> Delete(int id)
        {
            await _repository.Delete(id);

            return(NoContent());
        }