You are developing an application that includes a class named Employee and a generic list of employees. The following code segment declares the list of employees:
List<Employee> employeesList = new List<Employee>();
You populate the employeesList object with several hundred Employee objects.
The application must display the data for five Employee objects at a time.
You need to create a method that will return the correct number of Employee objects.
Which code segment should you use?

Correct Answer: B
Explanation
public static IEnumerable Page(IEnumerable source, int page, int pageSize)
{
return source.Skip((page - 1) * pageSize).Take(pageSize);
}
if page 1 means it skips 0 and take the pageSize
if page 2 means it skips first page and take the 2nd page.