Exemple #1
0
        public ICommandResult HandleUpdate(UpdateOrderComand command)
        {
            // Obter o cliente (Lendo do repositorio)
            var customer = _customerRepository.Get(command.CustomerId);
            // Obter o pedido
            var order = _orderRepository.GetById(command.OrderId);

            // Alterar o pedido
            order.ToChangeStatus(command.Status);
            // Persiste no banco
            _orderRepository.Save(order);
            return(new OrderCommandResult(true, "Pedido Alterado com sucesso!", order.Number));
        }
 public ICommandResult Put(UpdateOrderComand command)
 {
     return(_handler.HandleUpdate(command));
 }