Hello @Bas H ,
how do i get the last 10 items from this List Descending
You could descend the list according to the BalId
, then take 10 objects, refer to the following code :
List<Fotos> fooList2 = fooList.OrderByDescending(x => x.BalId).Take(10).ToList();
But it's not clear that if you want to get the last 10 items from the obtained list. If so, you can try the following code:
List<Fotos> fooList3 = fooList.Skip(Math.Max(0, fooList.Count - 10)).ToList();// fooList is the list you get from database
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.