Exemplo n.º 1
0
        public async Task <IActionResult> Index(int page = 1, string name = "", decimal minPrice = 0, decimal maxPrice = 10000, int manufacturer = 0)
        {
            var mobilesFiltered = await _mobile.GetFilteredMobiles(name, manufacturer, minPrice, maxPrice, page, 6);

            var manufacturers = await _mobile.GetManufacturers();

            var pm = new PagingModel {
                Data = mobilesFiltered.Mobiles, Count = mobilesFiltered.Count, SearchString = name, Manufacturer = manufacturer, Manufacturers = manufacturers, MinPrice = minPrice, MaxPrice = maxPrice, CurrentPage = page
            };

            return(View(pm));
        }