/// <summary> /// Gets the paged collection of products in the collection. /// </summary> /// <param name="value"> /// The <see cref="ProductCollection"/>. /// </param> /// <param name="page"> /// The page. /// </param> /// <param name="itemsPerPage"> /// Number of items per page. /// </param> /// <param name="sortBy"> /// The sort field. /// </param> /// <param name="sortDirection"> /// The sort direction. /// </param> /// <param name="enableDataModifiers"> /// A value indicating whether or not to enable data modifiers in the MerchelloHelper /// </param> /// <returns> /// The <see cref="IEnumerable{IProductContent}"/>. /// </returns> public static PagedCollection <IProductContent> GetProductsPaged( this IProductCollection value, long page, long itemsPerPage, string sortBy = "", SortDirection sortDirection = SortDirection.Ascending, bool enableDataModifiers = true) { var merchelloHelper = new MerchelloHelper(enableDataModifiers); return(value.GetProducts(merchelloHelper, page, itemsPerPage, sortBy, sortDirection)); }
/// <summary> /// Gets the collection of all products in the collection. /// </summary> /// <param name="value"> /// The <see cref="ProductCollection"/>. /// </param> /// <param name="enableDataModifiers"> /// A value indicating whether or not to enable data modifiers in the MerchelloHelper /// </param> /// <returns> /// The <see cref="IEnumerable{IProductContent}"/>. /// </returns> public static IEnumerable <IProductContent> GetProducts(this IProductCollection value, bool enableDataModifiers = true) { return(value.GetProducts(1, long.MaxValue, enableDataModifiers: enableDataModifiers)); }