public IActionResult PutUser(int id, Appointment userProduct) { if (id != userProduct.Id) { return(BadRequest()); } service.Update(userProduct); try { service.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public bool Update(int id, int userId, int productId) { var userProduct = new UserProduct { Id = id, UserId = userId, ProductId = productId }; return(_userProductService.Update(userProduct)); }