public async Task <OrderListModel> PrepareEditModel(Guid orderId)
        {
            var model = new OrderListModel();
            var order = await _appService.GetById(orderId);

            model.OrderId        = orderId;
            model.NewOrderNumber = order.Number;
            var customers = await _customerAppService.GetAll();

            model.Customers = customers.Select(x => new SelectListItem {
                Text = x.CompanyName, Value = x.Id.ToString()
            }).ToList();
            model.Customers.FirstOrDefault(x => x.Value == order.CustomerId.ToString()).Selected = true;

            var companies = await _companyAppService.GetAll();

            model.Companies = companies.Select(x => new SelectListItem {
                Text = x.Name, Value = x.Id.ToString()
            }).ToList();
            model.Companies.FirstOrDefault(x => x.Value == order.CompanyId.ToString()).Selected = true;

            //ISSUE
            var address = await _addressAppService.GetAllByCustomerId(order.CustomerId);

            model.Addresses = address.Select(x => new SelectListItem {
                Text = x.StreetAddress, Value = x.Id.ToString()
            }).ToList();
            model.Addresses.FirstOrDefault(x => x.Value == order.CustomerAddressId.ToString()).Selected = true;

            var paymentTypes = await _paymentTypeAppService.GetAll();

            model.PaymentTypes = paymentTypes.Select(x => new SelectListItem {
                Text = x.TypeName, Value = x.Id.ToString()
            }).ToList();
            model.PaymentTypes.FirstOrDefault(x => x.Value == order.PaymentTypeId.ToString()).Selected = true;
            return(model);
        }
        /// <summary>
        /// Makes a select list of addresses
        /// </summary>
        /// <returns>SelectList of addresses</returns>
        private async Task <List <Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> > Addresses(List <Microsoft.AspNetCore.Mvc.Rendering.SelectListItem> customers)
        {
            //Make sure we have customers.
            if (customers.Any())
            {
                var firstAddresses = await _addressAppService.GetAllByCustomerId(new Guid(customers.First().Value));

                if (firstAddresses.Any())
                {
                    return(firstAddresses.Select(x => new Microsoft.AspNetCore.Mvc.Rendering.SelectListItem {
                        Text = x.Province + " " + x.StreetAddress + " " + x.HouseNumber, Value = x.Id.ToString()
                    }).ToList());
                }
            }
            return(new List <Microsoft.AspNetCore.Mvc.Rendering.SelectListItem>());
        }