public void AddToBasket(string userId, int productId, int quantity) { var basket = GetBasketByUserId(userId); if (basket != null) { var index = basket.BasketDetails.FindIndex(i => i.ProductId == productId); if (index < 0) { basket.BasketDetails.Add(new BasketDetail() { ProductId = productId, Quantity = quantity, BasketId = basket.Id }); } else { basket.BasketDetails[index].Quantity += quantity; } _basketDal.Update(basket); } }
public IResult Update(int basketId) { _basketDal.Update(new Basket { Id = basketId }); return(new SuccessResult(Messages.SuccessUpdated)); }
public IResult Update(Basket basket) { _basketDal.Update(basket); return(new SuccessResult(BusinessMessages.BasketUpdated)); }
public IResult Update(Basket basket) { _basketDal.Update(basket); return(new SuccessResult(Messages.ProductUpdated)); }
public Basket Update(Basket entity) { return _BasketDal.Update(entity); }
public IResult Update(Basket basket) { _basketDal.Update(basket); return(new SuccessResult("güncelleme işlemi başarılı ")); }
public IResult Update(Basket basket) { _basketDal.Update(basket); return(new SuccessResult("Ürün güncellendi.")); }
public IResult Update(Basket entity) { _basketDal.Update(entity); return(new SuccessResult()); }
public void Update(Basket basket) { _basketDal.Update(basket); }