Example #1
0
 /// <summary>
 /// Loads post's comments
 /// </summary>
 /// <param name="options"><see cref="LinkedInGetGroupPostCommentsOptions"/> object representing comments retrieval options</param>
 /// <returns>Request result</returns>
 /// <remarks>This is synchronous operation, i.e. the current thread will be suspended until it finishes to load all comments. If you want to load post's comments asynchronously, consider to use <see cref="LinkedInClient.GetPostComments"/> function instead</remarks>
 public LinkedInResponse <bool> LoadComments(LinkedInGetGroupPostCommentsOptions options)
 {
     try
     {
         if (_Comments == null)
         {
             _Comments = new List <LinkedInGroupComment>();
         }
         else
         {
             _Comments.Clear();
         }
         options.PostId = Id;
         _Comments.AddRange(RequestRunner.GetPostComments(options));
         return(new LinkedInResponse <bool>(true, LinkedInResponseStatus.OK, null));
     }
     catch (WebException wex)
     {
         return(Utils.GetResponse(false, wex, null));
     }
     catch (Exception ex)
     {
         return(new LinkedInResponse <bool>(false, LinkedInResponseStatus.OtherException, null, ex));
     }
 }