Example #1
0
        public ActionResult Confirm(Order order)
        {
            ServiceBus.Bus.Send(
                new ProcessOrderCommand
            {
                OrderId     = Guid.NewGuid(),
                Article     = order.Article,
                Description = order.Description,
                Count       = order.Count,
                Total       = order.Price
            });

            return(View("Success"));
        }
        public ActionResult Confirm(Order order)
        {
            ServiceBus.Bus.Send(
                new ProcessOrderCommand
                {
                    OrderId = Guid.NewGuid(),
                    Article = order.Article,
                    Description = order.Description,
                    Count = order.Count,
                    Total = order.Price
                });

            return View("Success");
        }
        public ActionResult Index(Order order)
        {
            // do Request / Response for total price
            var callback = ServiceBus.Bus.Send(
                new PriceRequestMessage
                {
                    Count = order.Count,
                    Price = order.Price
                }).
                Register(result =>
                {
                    var localResult = (CompletionResult) result.AsyncState;
                    var reply = (PriceResponseMessage) localResult.Messages[0];
                    order.Price = reply.Total;
                }, null);
            callback.AsyncWaitHandle.WaitOne();

            return View("Review", order);
        }
Example #4
0
        public ActionResult Index(Order order)
        {
            // do Request / Response for total price
            var callback = ServiceBus.Bus.Send(
                new PriceRequestMessage
            {
                Count = order.Count,
                Price = order.Price
            }).
                           Register(result =>
            {
                var localResult = (CompletionResult)result.AsyncState;
                var reply       = (PriceResponseMessage)localResult.Messages[0];
                order.Price     = reply.Total;
            }, null);

            callback.AsyncWaitHandle.WaitOne();

            return(View("Review", order));
        }