public async Task <IActionResult> UpdateShow([FromRoute] int id, [FromBody] ShowViewModel show) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != show.ID) { return(BadRequest()); } try { var updated = await _showsService.Update(show); return(Ok(updated)); } catch (DbUpdateConcurrencyException) { if (_showsService.GetById(id) == null) { return(NotFound()); } else { throw; } } }
public ActionResult <Model.Show> Update(int showId, Model.Requests.InsertShowRequest request) { return(_service.Update(showId, request)); }