Ejemplo n.º 1
0
        public OrderCommandResult Handle(OrderCommand order)
        {
            var items = FindOrderedItems(order);

            var price = items.Sum(x => x.Price);

            bool paidOk = TakePayment(order, price);

            return(paidOk
                ? OrderCommandResult.Success(items.ToArray())
                : OrderCommandResult.Failed());
        }