public BillingViewModel Build()
 {
     if (authentication.IsSignedIn())
     {
         var signedInCustomer = authentication.CustomerData;
         var extendedCustomer = accountService.GetExtendedCustomerByEmail(signedInCustomer.Email);
         var viewModel        = mapper.Map <ExtendedCustomer, BillingViewModel>(extendedCustomer);
         viewModel.PaymentMethod = checkoutDetailsModel.PaymentMethod;
         return(viewModel);
     }
     return(mapper.Map <CheckoutDetailsModel, BillingViewModel>(checkoutDetailsModel));
 }
        public MyAccountViewModel Build()
        {
            var viewModel = new MyAccountViewModel();
            var orders    = orderRepository.GetOrdersByCustomerEmail(userEmail);
            var customer  = customerAccountService.GetExtendedCustomerByEmail(userEmail);

            var mergeOrdersAndCustomer = new MergeOrdersAndCustomer();

            mergeOrdersAndCustomer.First  = orders;
            mergeOrdersAndCustomer.Second = customer;

            viewModel = mapper.Map <MergeOrdersAndCustomer, MyAccountViewModel>(mergeOrdersAndCustomer);

            return(viewModel);
        }