public static PaginationResultModel <T> GetItemsWithPagination <T>(IQueryable <T> items, int page, int size, string orderBy = "Id")
        {
            var searchResult  = new PaginationResultModel <T>();
            int numberOfItems = items.Count();

            if (numberOfItems > 0)
            {
                searchResult.NumberOfPage = CaculateNumberOfPage(size, numberOfItems);
                if (page >= searchResult.NumberOfPage)
                {
                    page = 0;
                }
                items = (from c in items
                         orderby orderBy descending
                         select c).Skip(page * size).Take(size);

                searchResult.Items         = items.ToList();
                searchResult.NumberOfItems = numberOfItems;
                return(searchResult);
            }
            else
            {
                return(searchResult);
            }
        }
        public static PaginationResultModel <T> GetItemsWithPagination <T>(IEnumerable <T> items, int page, int size) where T : DomainEntity <T>
        {
            var searchResult  = new PaginationResultModel <T>();
            int numberOfItems = items.Count();

            if (numberOfItems > 0)
            {
                searchResult.NumberOfPage = CaculateNumberOfPage(size, numberOfItems);
                items = (from c in items
                         orderby c.Id descending
                         select c).Skip(page * size).Take(size);

                searchResult.Items         = items.ToList();
                searchResult.NumberOfItems = numberOfItems;
                return(searchResult);
            }
            return(searchResult);
        }