Ejemplo n.º 1
0
 public override async Task <Invoice> CreateAsync()
 {
     return(await RegisterBaseTypesAsync(new Invoice
     {
         Customer = await _customerFactory.CreateAsync(),
         InvoiceItemCollection = new List <InvoiceItem>()
     }));
 }
Ejemplo n.º 2
0
        public async Task <CreateCustomerHandlerResponse> HandleAsync(CreateCustomerHandlerRequest request)
        {
            var customer = await _customerFactory.CreateAsync(request.FirstName, request.LastName, request.Email, request.DateOfBirth);

            await _customerRepository.CreateAsync(customer);

            await _unitOfWork.SaveAsync();

            return(new CreateCustomerHandlerResponse {
                Customer = customer
            });
        }