private void UpdatePullRequestReview(JObject contents, IGitHubPullRequestChanges gitHubPullRequestChanges)
        {
            var targetPrId = contents["pull_request"]["number"].ToString();
            var state      = GitHubConverters.ToApprovalState(contents["review"]["state"].ToString());

            if (state.HasValue)
            {
                gitHubPullRequestChanges.ReceivePullRequestReview(id: targetPrId, review: new GitService.PullRequestReview
                {
                    Author        = contents["review"]["user"]["login"].ToString(),
                    State         = state.Value,
                    SubmittedDate = contents["review"].Value <DateTimeOffset>("submitted_at").ToString("s", System.Globalization.CultureInfo.InvariantCulture),
                    Url           = contents["review"]["_links"]["html"]["href"].ToString()
                }, remove: contents["action"].ToString() == "dismissed");
            }
        }
 private ImmutableList <PullRequestReview> ToPullRequestReviews(JArray data)
 {
     return((from entry in data
             let user = entry["author"]["login"].ToString()
                        let state = GitHubConverters.ToApprovalState(entry["state"].ToString())
                                    where state.HasValue
                                    group new
     {
         state = state.Value,
         createdAt = entry["createdAt"].ToString(),
         resourcePath = entry["resourcePath"].ToString()
     } by user into states
             let target = states.OrderByDescending(t => t.createdAt).Last()
                          select new PullRequestReview
     {
         State = target.state,
         SubmittedDate = target.createdAt,
         Url = ResourcePathToUrl(target.resourcePath.ToString()),
         Author = states.Key,
     }).ToImmutableList());
 }