public BillingAddressViewModel(CustomerAddress address, SelectList countries, SelectList addresses = null)
        {
            if (address != null)
            {
                BillingAddressLine1      = address.Line1;
                BillingAddressLine2      = address.Line2;
                BillingAddressCity       = address.City;
                BillingAddressPostalCode = address.PostalCode;
                BillingAddressState      = address.State?.StateDisplayName ?? String.Empty;
                BillingAddressCountry    = address.Country?.CountryDisplayName ?? String.Empty;
                Countries = countries;
            }

            BillingAddressCountryStateSelector = new CountryStateViewModel
            {
                Countries = countries,
                CountryID = address?.CountryID ?? 0,
                StateID   = address?.StateID ?? 0
            };

            BillingAddressSelector = new AddressSelectorViewModel
            {
                Addresses = addresses,
                AddressID = address?.ID ?? 0
            };
        }
        public BillingAddressViewModel(AddressInfo address, SelectList countries, SelectList addresses = null)
        {
            if (address != null)
            {
                BillingAddressLine1      = address.AddressLine1;
                BillingAddressLine2      = address.AddressLine2;
                BillingAddressCity       = address.AddressCity;
                BillingAddressPostalCode = address.AddressZip;
                BillingAddressState      = StateInfoProvider.GetStateInfo(address.AddressStateID)?.StateDisplayName ?? String.Empty;
                BillingAddressCountry    = CountryInfoProvider.GetCountryInfo(address.AddressCountryID)?.CountryDisplayName ?? String.Empty;
                Countries = countries;
            }

            BillingAddressCountryStateSelector = new CountryStateViewModel
            {
                Countries = countries,
                CountryID = address?.AddressCountryID ?? 0,
                StateID   = address?.AddressStateID ?? 0
            };

            BillingAddressSelector = new AddressSelectorViewModel
            {
                Addresses = addresses,
                AddressID = address?.AddressID ?? 0
            };
        }
        public BillingAddressViewModel(AddressInfo address, SelectList countries, ICountryRepository countryRepository, SelectList addresses = null)
        {
            if (address != null)
            {
                if (countryRepository == null)
                {
                    throw new ArgumentNullException(nameof(countryRepository));
                }

                BillingAddressLine1      = address.AddressLine1;
                BillingAddressLine2      = address.AddressLine2;
                BillingAddressCity       = address.AddressCity;
                BillingAddressPostalCode = address.AddressZip;
                BillingAddressState      = countryRepository.GetState(address.AddressStateID)?.StateDisplayName ?? String.Empty;
                BillingAddressCountry    = countryRepository.GetCountry(address.AddressCountryID)?.CountryDisplayName ?? String.Empty;
                Countries = countries;
            }

            BillingAddressCountryStateSelector = new CountryStateViewModel
            {
                Countries = countries,
                CountryID = address?.AddressCountryID ?? 0,
                StateID   = address?.AddressStateID ?? 0
            };

            BillingAddressSelector = new AddressSelectorViewModel
            {
                Addresses = addresses,
                AddressID = address?.AddressID ?? 0
            };
        }