tags:

views:

35

answers:

1

I have a IList. where the object PersonDetails consists of the persons name, address and phone number. The list consists of more than 1000 person details. I would like to display 50 PersonDetails per page. Is there a way to select only 50 elements from the list, and return them. For example.

myList.select(1,50)
myList.select(51, 100)

I am able to select only first 50 by using. myList.Take(50); The entire list is at the wcf service, and i would like to get only fifty elements at a time.

+4  A: 

This will select second 50 elements (by skipping first 50):

var elements = myList
    .Skip(50)
    .Take(50)
    .ToList();

Skip method bypasses a specified number of elements in a sequence and then returns the remaining elements.

Alex