public IHttpActionResult PutGame(int id, Game game) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != game.ID_Game) { return(BadRequest()); } db.Entry(game).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!GameExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult DeletePlayerDota(int PlayerID) { var a = db.PlayerGames.Where(x => x.IDGamer == PlayerID && x.IDGame == (int)Games.Dota).FirstOrDefault(); if (a == null) { return(NotFound()); } db.PlayerGames.Remove(a); db.SaveChanges(); return(Ok()); }