Exemplo n.º 1
0
        /// <summary>
        /// Show in a partial view the result of top n rented products
        /// In the index page, the user choose top 5, 10, 25 etc
        /// and then the partial view ask the the ressult to the database
        /// depending on the user demand
        /// </summary>
        /// <param name="topValue"></param>
        /// <returns>PartialView</returns>
        public ActionResult IndexTop(int topValue)
        {
            ProductsDb dbProducts = new ProductsDb();
            RentDb     dbRent     = new RentDb();

            ModelState.Clear();
            AccueilViewModel vm = new AccueilViewModel
            {
                Product = dbProducts.GetTopNProducts(topValue)
            };

            return(PartialView(vm));
        }