Paging Error :The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'
You do have a Skip
method.
The PagedList
added it for you. Check the code out. That's how paging works, Take
and Skip
.
Also I think your case statement was meant to be
switch (sortBy)
{
case "Name desc":
employee = employee.OrderByDescending(x => x.FUllName);
break;
default: // Not: case "Default"
employee = employee.OrderBy(x => x.FUllName);
break;
}