예제 #1
0
        public IActionResult Delete(int id)
        {
            var userProduct = _cartRepo.GetUserProducts().FirstOrDefault(x => x.UserId == userId && x.ProductId == id);

            if (userProduct == null)
            {
                return(BadRequest(ModelState));
            }

            _cartRepo.Delete(userProduct.Id);

            return(Ok(this.Get()));
        }
예제 #2
0
 public void Delete(DataContracts.UserProducts entity)
 {
     _repo.Delete(entity);
 }