Skip to content

Commit

Permalink
Fix #2295 by reading the $top variable from the Query String.
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Sep 17, 2014
1 parent 615f498 commit cd9f332
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/NuGetGallery/DataServices/SearchAdaptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,23 @@ private static bool TryReadSearchFilter(bool allVersionsInIndex, string url, out
return false;
}

string skip;
if (queryTerms.TryGetValue("$skip", out skip))
string skipStr;
if (queryTerms.TryGetValue("$skip", out skipStr))
{
int result;
if (int.TryParse(skip, out result))
int skip;
if (int.TryParse(skipStr, out skip))
{
searchFilter.Skip = result;
searchFilter.Skip = skip;
}
}

string topStr;
if (queryTerms.TryGetValue("$top", out topStr))
{
int top;
if(int.TryParse(topStr, out top))
{
searchFilter.Take = top;
}
}

Expand Down

0 comments on commit cd9f332

Please sign in to comment.