Ejemplo n.º 1
0
        public Guid TakeOrder(int tableNumber, IEnumerable <LineItem> items, bool isDodgy)
        {
            var order = new WaitersOrder(new JObject());

            order.Id           = Guid.NewGuid();
            order.TableNumber  = tableNumber;
            order.OrderTakenAt = DateTime.Now;

            foreach (var item in items)
            {
                order.AddItem(item);
            }

            var orderPlaced = new OrderPlaced {
                Order = order.InnerItem
            };

            orderPlaced.CorrelationId    = orderPlaced.Id.ToString();
            orderPlaced.Order["IsDodgy"] = isDodgy;
            _publisher.Publish(orderPlaced);

            return(order.Id);
        }
Ejemplo n.º 2
0
 public void Handle(OrderPlaced order)
 {
     StartCooking(order, order.Order);
 }