public PageList <ProductType> GetroductTypePageList(PagingParams pagingParams) { if (string.IsNullOrEmpty(pagingParams.SearchString)) { var providersdb = _productTypeRepository.GetAllRecords().OrderByDescending(x => x.ModifyDate); List <ProductType> providers = providersdb.ToList(); var query = providers.AsQueryable(); return(new PageList <ProductType>(query, pagingParams.PageNumber, pagingParams.PageSize)); } else { var providersdb = _productTypeRepository.GetAllRecords().Where(x => x.Name.Contains(pagingParams.SearchString)).OrderByDescending(x => x.ModifyDate); List <ProductType> providers = providersdb.ToList(); var query = providers.AsQueryable(); return(new PageList <ProductType>(query, pagingParams.PageNumber, pagingParams.PageSize)); } }