public void Update(Product product) { var productToUpdate = Products.FirstOrDefault(p => p.Id == product.Id); if (productToUpdate != null) productToUpdate.UpdateProduct(product); }
public void CreateProduct(Product product) { productsRepository.Add(product); var hub = GlobalHost.ConnectionManager.GetHubContext<ProductsHub>(); hub.Clients.All.productAdded(product); }
public void Add(Product product) { Products.Add(product); }
public void UpdateProduct(Product product) { productsRepository.Update(product); }