示例#1
0
        public void Create()
        {
            var result = addressBuilder.From(new CustomerToCreateDto());

            if (result == null)
            {
                throw new InvalidOperationException();
            }
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }