diff --git a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml.cs b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml.cs index 07ea6148a3e..522e31f9c16 100644 --- a/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml.cs +++ b/src/dotnet/APIView/APIViewWeb/Pages/Assemblies/Review.cshtml.cs @@ -91,23 +91,6 @@ public async Task OnGetAsync(string id, string revisionId = null) showDocumentation: (ShowDocumentation ?? false), showDiffOnly: ShowDiffOnly, diffContextSize: REVIEW_DIFF_CONTEXT_SIZE, diffContextSeperator: DIFF_CONTEXT_SEPERATOR); - if (!String.IsNullOrEmpty(ReviewContent.ActiveAPIRevision.Files.First().CrossLanguagePackageId)) - { - var correspondingReviewId = await _apiRevisionsManager.GetReviewIdsOfLanguageCorrespondingReviewAsync(ReviewContent.ActiveAPIRevision.Files.First().CrossLanguagePackageId); - var correspondingReviews = await _reviewManager.GetReviewsAsync(reviewIds: correspondingReviewId.Where(_ => _ != id).ToList(), isClosed: false); - foreach (var review in correspondingReviews) - { - var reviewContent = await PageModelHelpers.GetReviewContentAsync(configuration: _configuration, - reviewManager: _reviewManager, preferenceCache: _preferenceCache, userProfileRepository: _userProfileRepository, - reviewRevisionsManager: _apiRevisionsManager, commentManager: _commentsManager, codeFileRepository: _codeFileRepository, - signalRHubContext: _signalRHubContext, user: User, review: review, revisionId: null, diffRevisionId: null, - showDocumentation: (ShowDocumentation ?? false), showDiffOnly: ShowDiffOnly, diffContextSize: REVIEW_DIFF_CONTEXT_SIZE, - diffContextSeperator: DIFF_CONTEXT_SEPERATOR); - - ReviewContent.CrossLanguageViewContent.Add(review.Language, reviewContent); - } - } - if (ReviewContent.Directive == ReviewContentModelDirective.TryGetlegacyReview) { // Check if you can get review from legacy data @@ -153,6 +136,23 @@ public async Task OnGetAsync(string id, string revisionId = null) return RedirectToPage("LegacyReview", new { id = id }); } + if (!String.IsNullOrEmpty(ReviewContent.ActiveAPIRevision.Files.First().CrossLanguagePackageId)) + { + var correspondingReviewId = await _apiRevisionsManager.GetReviewIdsOfLanguageCorrespondingReviewAsync(ReviewContent.ActiveAPIRevision.Files.First().CrossLanguagePackageId); + var correspondingReviews = await _reviewManager.GetReviewsAsync(reviewIds: correspondingReviewId.Where(_ => _ != id).ToList(), isClosed: false); + foreach (var review in correspondingReviews) + { + var reviewContent = await PageModelHelpers.GetReviewContentAsync(configuration: _configuration, + reviewManager: _reviewManager, preferenceCache: _preferenceCache, userProfileRepository: _userProfileRepository, + reviewRevisionsManager: _apiRevisionsManager, commentManager: _commentsManager, codeFileRepository: _codeFileRepository, + signalRHubContext: _signalRHubContext, user: User, review: review, revisionId: null, diffRevisionId: null, + showDocumentation: (ShowDocumentation ?? false), showDiffOnly: ShowDiffOnly, diffContextSize: REVIEW_DIFF_CONTEXT_SIZE, + diffContextSeperator: DIFF_CONTEXT_SEPERATOR); + + ReviewContent.CrossLanguageViewContent.Add(review.Language, reviewContent); + } + } + return Page(); }