Пример #1
0
        public ActionResult Index()
        {
            var projects = _portfolioRepo.GetAllPortfolioProjects();

            var model = new PortfolioIndexVM
            {
                Projects = projects.ToList()
            };

            return(View(model));
        }
Пример #2
0
        public AdminPortfolioVM GetAllProjectsForVm()
        {
            var projects = _portfolioRepo.GetAllPortfolioProjects();
            var model    = new AdminPortfolioVM();

            //convert each portfolio project and add it to VM
            //in correct format
            foreach (var project in projects)
            {
                model.Projects.Add(new AdminPortfolioPartial
                {
                    Id    = project.Id,
                    Title = project.Name
                });
            }

            model.Projects.OrderBy(m => m.Id);
            return(model);
        }