Ejemplo n.º 1
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            var job = await _service.GetJobById(id);

            await _service.DeleteJob(job.Id);

            return(RedirectToAction(nameof(Index)));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <Job> > DeleteJob(string id)
        {
            try
            {
                var job = await _jobsService.GetJobById(id);

                if (job == null)
                {
                    return(NotFound());
                }

                await _jobsService.DeleteJob(id);

                await _jobsService.Save();

                return(Ok(job));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Ejemplo n.º 3
0
 public IActionResult DeleteConfirmed(int id)
 {
     _jobs.DeleteJob(id);
     return(RedirectToAction(nameof(Index)));
 }