Пример #1
0
        public static void GenerateOrder(ICustomerRepository customerRepository, IProductRepository productRepository, IOrderRepository orderRepository, RegisterOrderCommand command)
        {
            var handler = new OrderCommandHandler(customerRepository, productRepository, orderRepository);

            handler.Handle(command);

            if (handler.IsValid())
            {
                Console.WriteLine("Your order has been submitted");
            }
        }
Пример #2
0
        public static void GenerateOrder(
            ICustomerRepository customerRepository,
            IProductRepository productRepository,
            IOrderRepository orderRepository,
            RegisterOrderCommand command)
        {
            var handler = new OrderCommandHandler(customerRepository, productRepository, orderRepository);

            handler.Handle(command);

            if (handler.IsValid())
            {
                System.Console.WriteLine("Customer registrado com sucesso!");
            }
        }