Exemple #1
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken commentsSequence = ((JToken)inputObject["Comments"]);
         if (commentsSequence != null && commentsSequence.Type != JTokenType.Null)
         {
             foreach (JToken commentsValue in ((JArray)commentsSequence))
             {
                 CommentDetails commentDetails = new CommentDetails();
                 commentDetails.DeserializeJson(commentsValue);
                 this.Comments.Add(commentDetails);
             }
         }
         JToken commentUrlValue = inputObject["CommentUrl"];
         if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null)
         {
             this.CommentUrl = ((string)commentUrlValue);
         }
         JToken descriptionValue = inputObject["Description"];
         if (descriptionValue != null && descriptionValue.Type != JTokenType.Null)
         {
             this.Description = ((string)descriptionValue);
         }
         JToken itemsSequence = ((JToken)inputObject["Items"]);
         if (itemsSequence != null && itemsSequence.Type != JTokenType.Null)
         {
             foreach (JToken itemsValue in ((JArray)itemsSequence))
             {
                 AlbumItem albumItem = new AlbumItem();
                 albumItem.DeserializeJson(itemsValue);
                 this.Items.Add(albumItem);
             }
         }
         JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]);
         if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null)
         {
             foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence))
             {
                 LikeGroup likeGroup = new LikeGroup();
                 likeGroup.DeserializeJson(likeGroupsValue);
                 this.LikeGroups.Add(likeGroup);
             }
         }
         JToken likeUrlValue = inputObject["LikeUrl"];
         if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null)
         {
             this.LikeUrl = ((string)likeUrlValue);
         }
         JToken titleValue = inputObject["Title"];
         if (titleValue != null && titleValue.Type != JTokenType.Null)
         {
             this.Title = ((string)titleValue);
         }
         JToken userIdValue = inputObject["UserId"];
         if (userIdValue != null && userIdValue.Type != JTokenType.Null)
         {
             this.UserId = ((string)userIdValue);
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Deserialize the object
 /// </summary>
 public virtual void DeserializeJson(JToken inputObject)
 {
     if (inputObject != null && inputObject.Type != JTokenType.Null)
     {
         JToken commentsSequence = ((JToken)inputObject["Comments"]);
         if (commentsSequence != null && commentsSequence.Type != JTokenType.Null)
         {
             foreach (JToken commentsValue in ((JArray)commentsSequence))
             {
                 CommentDetails commentDetails = new CommentDetails();
                 commentDetails.DeserializeJson(commentsValue);
                 this.Comments.Add(commentDetails);
             }
         }
         JToken commentUrlValue = inputObject["CommentUrl"];
         if (commentUrlValue != null && commentUrlValue.Type != JTokenType.Null)
         {
             this.CommentUrl = ((string)commentUrlValue);
         }
         JToken descriptionValue = inputObject["Description"];
         if (descriptionValue != null && descriptionValue.Type != JTokenType.Null)
         {
             this.Description = ((string)descriptionValue);
         }
         JToken itemsSequence = ((JToken)inputObject["Items"]);
         if (itemsSequence != null && itemsSequence.Type != JTokenType.Null)
         {
             foreach (JToken itemsValue in ((JArray)itemsSequence))
             {
                 AlbumItem albumItem = new AlbumItem();
                 albumItem.DeserializeJson(itemsValue);
                 this.Items.Add(albumItem);
             }
         }
         JToken likeGroupsSequence = ((JToken)inputObject["LikeGroups"]);
         if (likeGroupsSequence != null && likeGroupsSequence.Type != JTokenType.Null)
         {
             foreach (JToken likeGroupsValue in ((JArray)likeGroupsSequence))
             {
                 LikeGroup likeGroup = new LikeGroup();
                 likeGroup.DeserializeJson(likeGroupsValue);
                 this.LikeGroups.Add(likeGroup);
             }
         }
         JToken likeUrlValue = inputObject["LikeUrl"];
         if (likeUrlValue != null && likeUrlValue.Type != JTokenType.Null)
         {
             this.LikeUrl = ((string)likeUrlValue);
         }
         JToken titleValue = inputObject["Title"];
         if (titleValue != null && titleValue.Type != JTokenType.Null)
         {
             this.Title = ((string)titleValue);
         }
         JToken userIdValue = inputObject["UserId"];
         if (userIdValue != null && userIdValue.Type != JTokenType.Null)
         {
             this.UserId = ((string)userIdValue);
         }
     }
 }