public void SaveBasketLineItem(int basketId, IProductLineItem lineItem) { var basketItem = _appDbContext.BasketLineItems.FirstOrDefault(l => l.BasketId == basketId && l.Product.Id == lineItem.Product.Id); if (basketItem != null) { basketItem.Quantity = lineItem.Quantity; } else { basketItem = new ProductLineItem { BasketId = basketId, Quantity = lineItem.Quantity, DiscountedLineCost = lineItem.DiscountedLineCost, Product = lineItem.Product }; _appDbContext.BasketLineItems.Add(basketItem); } _appDbContext.SaveChanges(); }
public void SaveBasketLineItem(int basketId, IProductLineItem lineItem) { throw new NotImplementedException(); }