Example #1
0
 public int MakeComment(int movieID, string commentText)
 {
     this.CheckAppKey();
     this.CheckLoggedIn();
     if (movieID < 0)
     {
         throw new ArgumentException("Movie id should be greater than 0.");
     }
     else if (string.IsNullOrWhiteSpace(commentText))
     {
         throw new ArgumentException("Comment text cannot be null or empty.");
     }
     else
     {
         var req    = YifyAPI.GetMakeCommentReqeust(this.appKey, this.userKey, movieID, commentText);
         var res    = YifyAPI.SendPostRequest(req);
         int parsed = _parser.ParseMakeCommentResponse(res);
         try
         {
             var xDoc = _parser.ToResponse(res);
             return(-1);
         }
         catch (Exception ex) { throw new YifyException("An error occurred. See inner exception for more details", ex); }
     }
 }