public static AddressDto ToGoogleAddressFormattedList(this DutyStationAddressDto homeFrontAddress) { return(new AddressDto { Address1 = homeFrontAddress.AddressLine1.Split(' ')[0], Address2 = homeFrontAddress.AddressLine1.Substring(homeFrontAddress.AddressLine1.IndexOf(' ') + 1), Address3 = homeFrontAddress.AddressLine3, Display = ToFullAddress(homeFrontAddress), }); }
public static string ToShortAddress(DutyStationAddressDto address) { if (!string.IsNullOrEmpty(address.CountryCode)) { if (address.CountryCode.IsUSA()) { return(string.Concat(string.IsNullOrEmpty(address.City) ? string.Empty : string.Concat(address.City, ", "), address.StateOrProvince)); } else { return(string.Concat(string.IsNullOrEmpty(address.City) ? string.Empty : string.Concat(address.City, ", "), address.CountryCode)); } } else { return(String.Empty); } }