Example #1
0
 public HttpResponseMessage ChangeProductCountInBasketById(ChangeProductCountData data)
 {
     var basket = _basketRepository.GetFirstOrDefault(z => z.Id == data.BasketId);
     if (basket == null) return ErrorResult();
     var allLines = ChangeProductCountAndSave(basket, data.Product.Id, data.Product.Count);
     return SuccessResult(GetViewBasketData(basket, allLines));
 }
Example #2
0
 public HttpResponseMessage RemoveProductFromBasketById(ChangeProductCountData data)
 {
     var basket = _basketRepository.GetFirstOrDefault(z => z.Id == data.BasketId);
     if (basket == null) return ErrorResult();
     RemoveProductFromBasketByProductId(basket, data.Product.Id, data.Product.Price);
     return SuccessResult();
 }