sort qui marche meme pour la dernière page

master
Thomas Chazot 2 years ago
parent 4544d88a08
commit ca45d052a0

@ -61,6 +61,11 @@ namespace BlazorApp.Services
{ {
List<Item> it = await _http.GetFromJsonAsync<List<Item>>($"https://localhost:7234/api/Crafting/all/"); List<Item> it = await _http.GetFromJsonAsync<List<Item>>($"https://localhost:7234/api/Crafting/all/");
it = it.OrderBy(i => i.DisplayName).ToList(); it = it.OrderBy(i => i.DisplayName).ToList();
if ((currentPage - 1) * 10+ pageSize > it.Count)
{
int tmp = ((currentPage - 1) * 10 + pageSize) - it.Count;
return it.GetRange((currentPage - 1) * 10, pageSize - tmp);
}
return it.GetRange((currentPage - 1) * 10, pageSize); return it.GetRange((currentPage - 1) * 10, pageSize);
} }

Loading…
Cancel
Save