public PagedList <CategoryModel> GetAllCategoryParent(PagingParams pagingParams)
        {
            DisplayCategory category = new DisplayCategory();

            category.objUser = this.objUser;
            var query = new List <CategoryModel>((List <CategoryModel>)category.DisplayCategoryParent()).AsQueryable();
            IQueryable <CategoryModel> filter;

            filter = query.Where(p => p.category_name.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));

            return(new PagedList <CategoryModel>(filter, pagingParams.PageNumber, pagingParams.PageSize));
        }
        public PagedList <CategoryModel> GetAllSubCategories(PagingParams pagingParams, string id)
        {
            DisplayCategory category = new DisplayCategory();

            category.objUser = this.objUser;
            var query = new List <CategoryModel>((List <CategoryModel>)category.DisplaySubCategory(id)).AsQueryable();
            IQueryable <CategoryModel> filter;


            if (pagingParams.Term.ToUpper() == "TYPE")
            {
                filter = query.Where(p => p.category_type.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));
            }
            else
            {
                filter = query.Where(p => p.category_name.StartsWith(pagingParams.Query ?? string.Empty, StringComparison.InvariantCultureIgnoreCase));
            }

            return(new PagedList <CategoryModel>(filter, pagingParams.PageNumber, pagingParams.PageSize));
        }