public ActionResult ProjectsSection() { var projects = _projectRepo.GetProjects(); var projectTypes = projects.DistinctBy(p => p.ProjectTypeId).Select(p => p.ProjectType).ToList(); var projectSectionVm = new ProjectSectionViewModel() { ProjectTypes = projectTypes, Projects = projects }; return(PartialView(projectSectionVm)); }
public ActionResult Index() { var projects = _repo.GetProjects(); var projectTypes = projects.DistinctBy(p => p.ProjectTypeId).Select(p => p.ProjectType).ToList(); var projectSectionVm = new ProjectSectionViewModel() { ProjectTypes = projectTypes, Projects = projects }; #region BreadCrumb var breadCrumbVm = new List <BreadCrumbViewModel>(); breadCrumbVm.Add(new BreadCrumbViewModel() { Title = "پروژه های فرادید", Href = "#" }); ViewBag.BreadCrumb = breadCrumbVm; #endregion return(View(projectSectionVm)); }