public async Task <IActionResult> Putcatagory(int id, catagory catagory) { if (id != catagory.cat_Id) { return(BadRequest()); } _context.Entry(catagory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!catagoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUserProduct(int id, UserProduct userProduct) { if (id != userProduct.piece_id) { return(BadRequest()); } _context.Entry(userProduct).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserProductExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFavorit(int id, Favorit favorit) { if (id != favorit.Id) { return(BadRequest()); } _context.Entry(favorit).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FavoritExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }