public async Task <IHttpActionResult> PutPlayerRequestedGroup(int id, PlayerRequestedGroup playerRequestedGroup) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != playerRequestedGroup.ID) { return(BadRequest()); } db.Entry(playerRequestedGroup).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayerRequestedGroupExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetPlayerRequestedGroup(int id) { PlayerRequestedGroup playerRequestedGroup = await db.PlayerRequestedGroup.FindAsync(id); if (playerRequestedGroup == null) { return(NotFound()); } return(Ok(playerRequestedGroup)); }
public async Task <IHttpActionResult> PostPlayerRequestedGroup(PlayerRequestedGroup playerRequestedGroup) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PlayerRequestedGroup.Add(playerRequestedGroup); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = playerRequestedGroup.ID }, playerRequestedGroup)); }
public async Task <IHttpActionResult> DeletePlayerRequestedGroup(int id) { PlayerRequestedGroup playerRequestedGroup = await db.PlayerRequestedGroup.FindAsync(id); if (playerRequestedGroup == null) { return(NotFound()); } db.PlayerRequestedGroup.Remove(playerRequestedGroup); await db.SaveChangesAsync(); return(Ok(playerRequestedGroup)); }