예제 #1
0
        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());
        }
예제 #2
0
        public bool Update(int id, int userId, int productId)
        {
            var userProduct = new UserProduct {
                Id = id, UserId = userId, ProductId = productId
            };

            return(_userProductService.Update(userProduct));
        }