Пример #1
0
        public async Task <ActionResult> Delete(int id)
        {
            try
            {
                if (await repository.DeleteAthleteAsync(id))
                {
                    return(Ok(new { message = "Atleta excluído com sucesso !" }));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(new
                {
                    error = string.Format("Parâmetros inválidos - Error {0}", e.Message)
                }));
            }

            return(NotFound(new { message = "Atleta não encontrado !" }));
        }