Exemplo n.º 1
0
        public async Task <IActionResult> Delete(int?id)
        {
            if (!id.HasValue)
            {
                return(NotFound());
            }
            try
            {
                await _timeRepositorio.DeletarTime(id.Value);
            }
            catch (TimeNaoEncontradoException ex)
            {
                return(NotFound());
            }

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public IActionResult Delete(int id)
        {
            try
            {
                _timeRepositorio.DeletarTime(id);

                return(Ok());
            }
            catch (TimeNaoEncontradoException)
            {
                return(NotFound());
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }