public void Delete(int productID) { Task.Run(() => { //LinqTools.RemoveProduct(productID); Product product = LinqTools.GetProductById(productID); product.DiscontinuedDate = DateTime.Today; LinqTools.UpdateProduct(product); CollectionChanged?.Invoke(); }); }
public void Upsert(Product product) { Task.Run(() => { if (LinqTools.GetProductById(product.ProductID) != null) { LinqTools.UpdateProduct(product); } else { LinqTools.AddNewProduct(product); } CollectionChanged?.Invoke(); }); }