private async void OnAddProduct() { CartItem cartitem; var CartList = await _cartRepo.GetItemsInCart(); var item = CartList.FirstOrDefault(x => x.ProductId == selectedToys.ID); if (item == null) { cartitem = new CartItem() { CartItemQuantity = 1, ProductId = selectedToys.ID, CartItemTotalPrice = selectedToys.Price }; await _cartRepo.AddProductAsync(cartitem); } else { item.CartItemQuantity++; int aantal = item.CartItemQuantity; double prijs = item.Product.Price; item.CartItemTotalPrice = aantal * prijs; await _cartRepo.UpdateProductAsync(item); } }