예제 #1
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken countValue = inputObject["count"];
         if (countValue != null && countValue.Type != JTokenType.Null)
         {
             this.Count = ((int)countValue);
         }
         JToken countryCodeValue = inputObject["countryCode"];
         if (countryCodeValue != null && countryCodeValue.Type != JTokenType.Null)
         {
             this.CountryCode = ((string)countryCodeValue);
         }
         JToken countryDescriptionValue = inputObject["countryDescription"];
         if (countryDescriptionValue != null && countryDescriptionValue.Type != JTokenType.Null)
         {
             this.CountryDescription = ((string)countryDescriptionValue);
         }
         JToken paginationValue = inputObject["pagination"];
         if (paginationValue != null && paginationValue.Type != JTokenType.Null)
         {
             Pagination pagination = new Pagination();
             pagination.DeserializeJson(paginationValue);
             this.Pagination = pagination;
         }
         JToken resultsSequence = ((JToken)inputObject["results"]);
         if (resultsSequence != null && resultsSequence.Type != JTokenType.Null)
         {
             foreach (JToken resultsValue in ((JArray)resultsSequence))
             {
                 Retailer retailer = new Retailer();
                 retailer.DeserializeJson(resultsValue);
                 this.Results.Add(retailer);
             }
         }
         JToken seoValue = inputObject["seo"];
         if (seoValue != null && seoValue.Type != JTokenType.Null)
         {
             Seo seo = new Seo();
             seo.DeserializeJson(seoValue);
             this.Seo = seo;
         }
     }
 }
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken countValue = inputObject["count"];
         if (countValue != null && countValue.Type != JTokenType.Null)
         {
             this.Count = ((int)countValue);
         }
         JToken resultsSequence = ((JToken)inputObject["results"]);
         if (resultsSequence != null && resultsSequence.Type != JTokenType.Null)
         {
             foreach (JToken resultsValue in ((JArray)resultsSequence))
             {
                 Retailer retailer = new Retailer();
                 retailer.DeserializeJson(resultsValue);
                 this.Results.Add(retailer);
             }
         }
     }
 }