Example #1
0
        internal static TaxAuthorityList getTaxAuthorityList(HttpResponseMessage response)
        {
            var taxAuthorityList = new TaxAuthorityList();
            var jsonObj          = JsonConvert.DeserializeObject <Dictionary <string, object> >(response.Content.ReadAsStringAsync().Result);

            if (jsonObj.ContainsKey("tax_authorities"))
            {
                var taxAuthorityArray = JsonConvert.DeserializeObject <List <object> >(jsonObj["tax_authorities"].ToString());
                foreach (var taxAuthorityObj in taxAuthorityArray)
                {
                    var taxAuthority = new TaxAuthority();
                    taxAuthority = JsonConvert.DeserializeObject <TaxAuthority>(taxAuthorityObj.ToString());
                    taxAuthorityList.Add(taxAuthority);
                }
            }
            return(taxAuthorityList);
        }
 internal static TaxAuthorityList getTaxAuthorityList(HttpResponseMessage response)
 {
     var taxAuthorityList = new TaxAuthorityList();
     var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(response.Content.ReadAsStringAsync().Result);
     if (jsonObj.ContainsKey("tax_authorities"))
     {
         var taxAuthorityArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["tax_authorities"].ToString());
         foreach(var taxAuthorityObj in taxAuthorityArray)
         {
             var taxAuthority = new TaxAuthority();
             taxAuthority = JsonConvert.DeserializeObject<TaxAuthority>(taxAuthorityObj.ToString());
             taxAuthorityList.Add(taxAuthority);
         }
     }
     return taxAuthorityList;
 }