Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductListModel"/> class.
        /// </summary>
        /// <param name="products">The products.</param>
        /// <param name="paging">The paging model.</param>
        /// <param name="sorting">The sorting model.</param>
        public ProductListModel([NotNull] IEnumerable <ProductModel> products, [NotNull] ProductPagingModel paging, [NotNull] ProductSortingModel sorting)
        {
            Assert.ArgumentNotNull(products, "products");
            Assert.ArgumentNotNull(paging, "paging");
            Assert.ArgumentNotNull(sorting, "sorting");

            this.products = products;
            this.paging   = paging;
            this.sorting  = sorting;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductListHeaderModel"/> class.
        /// </summary>
        /// <param name="paging">The paging information.</param>
        /// <param name="sorting">The sorting information.</param>
        public ProductListHeaderModel([NotNull] ProductPagingModel paging, [NotNull] ProductSortingModel sorting)
        {
            Assert.ArgumentNotNull(paging, "paging");
            Assert.ArgumentNotNull(sorting, "sorting");

            this.Paging = paging;

            this.PageSizes = new List <int> {
                6, 12, 18
            };

            this.Sorting      = sorting;
            this.SortingItems = this.GetSortingItems();
        }