示例#1
0
        public void performCreate(CustomerDto customerDto)
        {
            Notification notification = this.validation(customerDto);

            if (notification.hasErrors())
            {
                throw new ArgumentException(notification.errorMessage());
            }

            Customer customer = new Customer();

            customer.setFirstName(customerDto.getFirstName());
            customer.setLastName(customerDto.getLastName());
            this.customerRepository.save(customer);
        }