public async Task <IActionResult> UpdatePlayerShopInfo([FromRoute] int id, [FromBody] PlayerShopInfo tblPlayerShopInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tblPlayerShopInfo.PlayerShopInfoId) { return(BadRequest()); } try { await playerShopInfoesService.Update(id, tblPlayerShopInfo); } catch (DbUpdateConcurrencyException) { if (!TblPlayerShopInfoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <PlayerShopInfo> Insert(PlayerShopInfo tblPlayerShopInfo) { try { context.Add(tblPlayerShopInfo); await context.SaveChangesAsync(); return(tblPlayerShopInfo); } catch (Exception) { throw; } }
public async Task <IActionResult> InsertPlayerShopInfo([FromBody] PlayerShopInfo tblPlayerShopInfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var entity = await playerShopInfoesService.Insert(tblPlayerShopInfo); if (entity == null) { return(NotFound()); } return(CreatedAtAction("GetPlayerShopInfoByID", new { id = tblPlayerShopInfo.PlayerShopInfoId }, tblPlayerShopInfo)); }
public async Task Update(int Id, PlayerShopInfo tblPlayerShopInfo) { try { if (tblPlayerShopInfo == null) { throw new ArgumentNullException(nameof(tblPlayerShopInfo)); } if (Id != tblPlayerShopInfo.PlayerShopInfoId) { throw new NotImplementedException(); } context.TblPlayerShopInfo.Update(tblPlayerShopInfo); await context.SaveChangesAsync(); } catch (Exception) { throw; } }