using System.Text.Json.Serialization;
public static void Main()
var address = new AddressInfo
string strAddress = address.StringAddress();
Console.WriteLine(strAddress);
if (Encoding.UTF8.GetByteCount(strAddress) != strAddress.Length){
throw new ArgumentNullException($"Order contaions non ASCII character(s).");
Console.WriteLine("Shipped!!");
public int AddressId { get; set; }
public string CustomerId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string RegionName { get; set; }
public string CountryCode { get; set; }
public string CountryName { get; set; }
public string TelNumber { get; set; }
public DateTime DateCreated { get; set; }
public DateTime DateLastChanged { get; set; }
public string UsernameChangedBy { get; set; }
public string CountrySymbol { get; set; }
public string CompanyName { get; set; }
public string Fax { get; set; }
public string EmailAddress { get; set; }
public string StringAddress()
foreach (var prop in this.GetType().GetProperties())
var propValue = prop.GetValue(this);