private void OnAddToChart() { if (SelectedProduct != null) { ProductsInChart.Add(SelectedProduct); } }
private void OnBuy() { try { _buyingService.Validate(_availableProducts.Where(p => ProductsInChart.Select(pvm => pvm.Id).Contains(p.Id)).ToList(), _user); DisplayMessage("Your command is validated"); } catch (Exception ex) { DisplayMessage("Your command cannot be validated: " + ex.Message); } }