public IEnumerable <DTO.LookupList> GetIndexView(viewOptions o) { //Get all the records IQueryable <Lookup> q = repo.GetAllQ(); // //Search based on search-bar string if (!string.IsNullOrEmpty(o.sSearch)) { IndexViewBase.search(o, ref q); } if (!string.IsNullOrEmpty(o.category)) { IndexViewBase.byCategory(o, ref q); } IndexViewBase.sortOnColName(o.sortColName, o.orderDescending, ref q); return(q.ProjectTo <DTO.LookupList>(map.ConfigurationProvider) .Skip(o.displayStart) .Take(o.displayLength) .AsEnumerable()); }