Exemplo n.º 1
0
        public void Create()
        {
            var result = addressBuilder.From(new CustomerToCreateDto());

            if (result == null)
            {
                throw new InvalidOperationException();
            }
        }
Exemplo n.º 2
0
        public void Create(CustomerCreateCommand customercommand)
        {
            Customer customer = new Customer(customercommand.FirstName, customercommand.LastName);

            ICustomerAddressBuilder customerAddressBuilder = _mailingAddressFactory.GetAddressBuilder(true);

            // we need to verify that from is called in customer address builder...
            customer.MailingAddress = customerAddressBuilder.From(customercommand);

            _customerRepository.Save(customer);
        }
        public void Create(CustomerCreateCommand customercommand)
        {
            Customer customer = new Customer(customercommand.FirstName, customercommand.LastName);

            customer.MailingAddress = _customerAddressBuilder.From(customercommand);

            if (customer.MailingAddress == null)
            {
                throw new InvalidCustomerMailingAddressException();
            }

            _customerRepository.Save(customer);
        }
Exemplo n.º 4
0
        public void Create(CustomerToCreateDto customerToCreateDto)
        {
            var customer = new Customer(customerToCreateDto.Name, customerToCreateDto.City)
            {
                MailingAddress = _customerAddressBuilder.From(customerToCreateDto)
            };

            if (customer.MailingAddress == null)
            {
                throw new InvalidCustomerMailingAddressException();
            }

            _customerRepository.Save(customer);
        }
Exemplo n.º 5
0
        public void Create(CustomerToCreateDto customerToCreate)
        {
            var customer = new Customer(
                customerToCreate.FirstName,
                customerToCreate.LastName);

            customer.MailingAddress = customerAddressBuilder.From(customerToCreate);

            if (customer.MailingAddress == null)
            {
                throw new InvalidCustomerMailingAddressException();
            }

            customerRepository.Save(customer);
        }