public IActionResult Put(Hero hero) { _logger.LogInformation(hero.ToString()); // Is there a hero with the given ID? bool exists = _heroService.ExistsHero(hero.ID); if (!exists) { // HTTP status code: 404 (Not Found) return(NotFound(hero)); } // Update the hero. _heroService.SaveHero(hero); // REST API recommends either a status code of 200 (OK) or 204 (No Content) to be returned. // HTTP status code: 200 (OK) //return Ok(hero); // HTTP status code: 204 (No Content) return(NoContent()); }