示例#1
0
        /// <inheritdoc />
        public List <Product> GetProducts(int pageSize = 10, int pageIndex = 0)
        {
            // Get the correct amount of products
            var products = _productReader.GetProducts().Skip(pageIndex * pageSize).Take(pageSize).ToList();

            // Get the availiblity for each product
            foreach (var product in products)
            {
                product.Availability = _availabilityRepository.GetProductCount(product.Id);
            }

            return(products);
        }