Exemplo n.º 1
0
 public async Task <IActionResult> ChangeAnimal([FromRoute] int idAnimal, [FromBody] Animal animal)
 {
     try { DBService.ChangeAnimal(idAnimal, animal); }
     catch (NoExecutedQueryException) { return(NotFound($"No such animal found with ID {idAnimal}!")); }
     catch (Exception) { return(BadRequest("Entered data is not valid!")); }
     return(Ok("Succsesfully changed!"));
 }