// GET: Trainer/Delete/5
        public ActionResult Delete(int id)
        {
            utilisateur tr = trs.getOneTrainer(id);

            trs.DeleteTrainer(id);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <Trainer> > DeleteTrainer(int id)
        {
            try
            {
                await _trainersService.DeleteTrainer(id);

                return(Ok());
            }
            catch (InvalidOperationException ex)
            {
                return(NotFound(ex.Message));
            }
        }
Exemplo n.º 3
0
        public async Task <ActionResult> DeleteTrainer(int id)
        {
            try
            {
                await _trainerService.DeleteTrainer(id);

                return(Ok());
            }
            catch (ArgumentNullException exception)
            {
                return(NotFound(exception.Message));
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.Message));
            }
        }