Example #1
0
 /// <summary>
 /// Loads all update's comments (max 250)
 /// </summary>
 /// <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 update's comments asynchronously, consider to use <see cref="LinkedInClient.GetUpdateComments"/> function instead</remarks>
 public LinkedInResponse <bool> LoadComments()
 {
     try
     {
         if (_Comments == null)
         {
             _Comments = new List <LinkedInComment>();
         }
         else
         {
             _Comments.Clear();
         }
         var response = RequestRunner.GetAllUpdateComments(UpdateKey);
         if (response != null && response.Result != null && response.Status == LinkedInResponseStatus.OK)
         {
             _Comments.AddRange(response.Result);
         }
         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));
     }
 }