Candor.PagingOptions.GetDisabledPagingOptions C# (CSharp) Method

GetDisabledPagingOptions() public static method

Gets a set of PagingOptions with paging disabled.
public static GetDisabledPagingOptions ( ) : PagingOptions
return PagingOptions
        public static PagingOptions GetDisabledPagingOptions()
        {
            PagingOptions paging = new PagingOptions();
            paging.Enabled = false;
            return paging;
        }

Usage Example

        /// <summary>
        /// Creates a new paging options based on a nullable page and page size.
        /// </summary>
        /// <param name="page">Either null, or a 1 based page number (not page index)</param>
        /// <param name="itemsPerPage">Either null for the default, or the number of items for each page.</param>
        /// <returns></returns>
        public static PagingOptions GetPagingByPage(int?page, int?itemsPerPage)
        {
            if (!page.HasValue && !itemsPerPage.HasValue)
            {
                return(PagingOptions.GetDisabledPagingOptions());
            }

            if (!itemsPerPage.HasValue)
            {
                return new PagingOptions()
                       {
                           PageIndex = page.Value - 1
                       }
            }
            ;
            if (!page.HasValue)
            {
                return new PagingOptions()
                       {
                           PageIndex = 0, PageSize = itemsPerPage.Value
                       }
            }
            ;

            return(new PagingOptions()
            {
                PageIndex = page.Value - 1, PageSize = itemsPerPage.Value
            });
        }

        #endregion Specialty
    }
}
All Usage Examples Of Candor.PagingOptions::GetDisabledPagingOptions