Esempio n. 1
0
        private void Apply(ProductShipped shipProduct)
        {
            var product = GetProduct(shipProduct.Sku);

            product.Shipped += shipProduct.Quantity;
            _dbContext.SaveChanges();
        }
Esempio n. 2
0
        public void ProductShippedCommand(IBus bus)
        {
            Console.WriteLine("Please press enter to ship product");
            Console.ReadLine();

            ConsoleKeyInfo key = Console.ReadKey();

            if (key.Key != ConsoleKey.Enter)
            {
                return;
            }
            var product = new ProductShipped()
            {
                ProductId       = Guid.NewGuid(),
                ShippingAddress = "Pune"
            };

            bus.Send("host", product);
            Console.WriteLine("Product shipped of the id:{0}", product.ProductId);
        }
Esempio n. 3
0
 public void Handle(ProductShipped message)
 {
     Data.ProductId = message.ProductId;
     RequestTimeout <OrderTimeout>(TimeSpan.FromSeconds(5));
 }