예제 #1
0
        public void Update(Product product)
        {
            var productToUpdate = Products.FirstOrDefault(p => p.Id == product.Id);

            if (productToUpdate != null)
                productToUpdate.UpdateProduct(product);
        }
예제 #2
0
        public void CreateProduct(Product product)
        {
            productsRepository.Add(product);

            var hub = GlobalHost.ConnectionManager.GetHubContext<ProductsHub>();
            hub.Clients.All.productAdded(product);
        }
예제 #3
0
 public void Add(Product product)
 {
     Products.Add(product);
 }
예제 #4
0
 public void UpdateProduct(Product product)
 {
     productsRepository.Update(product);
 }