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())); }
public void Delete(DataContracts.UserProducts entity) { _repo.Delete(entity); }