public async Task <IHttpActionResult> PutMatch(int id, Match match) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != match.Id) { return(BadRequest()); } db.Entry(match).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MatchExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public void UpdateItem(Fixture fixture) { context.Entry(fixture).State = System.Data.Entity.EntityState.Modified; }