Ejemplo n.º 1
0
 public async Task <IActionResult> Delete(int id)
 {
     if (await _kindService.Delete(id))
     {
         return(NoContent());
     }
     throw new Exception("Error deleting the Kind");
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Delete(int Id)
        {
            try
            {
                if (Id == 0)
                {
                    return(BadRequest());
                }

                await _kindService.Delete(Id);

                return(Ok("Deleted"));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, e));
            }
        }