コード例 #1
0
        public virtual ActionResult List(int categoryID = 0)
        {
            var modelViewModel = new ModelListViewModel();

            modelViewModel.Models = ModelSearch(categoryID: categoryID);

            if (categoryID != 0)
            {
                if (modelViewModel.Models.Count >= 12)
                {
                    modelViewModel.Models12 = modelViewModel.Models.Take(12).ToList();
                    modelViewModel.Models.RemoveRange(0, 12);
                }
            }

            return View(modelViewModel);
        }
コード例 #2
0
        private ModelListViewModel ConstructModelViewModel(int categoryID, List<ModelResult> results)
        {
            var modelViewModel = new ModelListViewModel()
            {
                 Models = results,
            };

            if (categoryID > 0)
            {
                if (modelViewModel.Models.Count >= 12)
                {
                    modelViewModel.Models12 = modelViewModel.Models.Take(12).ToList();
                    modelViewModel.Models.RemoveRange(0, 12);
                }
            }

            return modelViewModel;
        }