public async Task <ActionResult <player_summaries> > Postplayer_summaries(player_summaries player_summaries) { _context.player_summaries.Add(player_summaries); await _context.SaveChangesAsync(); return(CreatedAtAction("Getplayer_summaries", new { id = player_summaries.steamid }, player_summaries)); }
public async Task <IActionResult> Putplayer_summaries(long id, player_summaries player_summaries) { if (id != player_summaries.steamid) { return(BadRequest("Id doesn't match id in body!")); } _context.Entry(player_summaries).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!player_summariesExists(id)) { return(NotFound("The record doesn't exist *sad raccoon noises*")); } else { throw; } } return(NoContent()); }