예제 #1
0
 /// <summary>
 /// Loads all update's likes (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 likes. If you want to load update's likes asynchronously, consider to use <see cref="LinkedInClient.GetUpdateLikes"/> function instead</remarks>
 public LinkedInResponse <bool> LoadLikes()
 {
     try
     {
         if (_Likes == null)
         {
             _Likes = new List <LinkedInLike>();
         }
         else
         {
             _Likes.Clear();
         }
         var response = RequestRunner.GetAllUpdateLikes(UpdateKey);
         if (response != null && response.Result != null && response.Status == LinkedInResponseStatus.OK)
         {
             _Likes.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));
     }
 }