public async Task <IActionResult> PutUsers(int id, Users user) { if (id != user.Id) { return(BadRequest()); } _context.Entry(user).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPurchasedItems(int id, PurchasedItems purchasedItems) { if (id != purchasedItems.Id) { return(BadRequest()); } _context.Entry(purchasedItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PurchasedItemsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPageViewCount(int id, PageViewCount pageViewCount) { if (id != pageViewCount.Id) { return(BadRequest()); } _context.Entry(pageViewCount).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PageViewCountExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }