Ejemplo n.º 1
0
        public async Task <bool> Handle(CreateCustomerCommand message, CancellationToken cancellationToken)
        {
            var customer = Customer.CustomerFactory.NewCustomer(message.Name);

            if (!IsValid(customer))
            {
                return(false);
            }
            await saleRepository.AddCustomer(customer);

            return(await Commit());
        }