Exemplo n.º 1
0
        public async Task <IActionResult> DeletePlayer(int?id)
        {
            int result = 0;

            if (id == null)
            {
                return(BadRequest());
            }

            try
            {
                result = await league.DeletePlayer(id);

                if (result == 0)
                {
                    return(NotFound());
                }
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }