public ActionResult Index(int?id) { if (id.HasValue) { ViewData["ActiveSection"] = this._sectionService.GetSectionById(id.Value); } var sharedSections = this._sectionService.GetUnconnectedSections(this.CuyahogaContext.CurrentSite); var model = new List <SharedSectionViewData>(); foreach (var sharedSection in sharedSections) { var sharedSectionViewData = new SharedSectionViewData(sharedSection); sharedSectionViewData.AttachedToTemplates = String.Join(", ", this._sectionService.GetTemplatesBySection(sharedSection). Select(t => t.Name).ToArray()); model.Add(sharedSectionViewData); } return(View(model)); }
public ActionResult Index(int? id) { if (id.HasValue) { ViewData["ActiveSection"] = this._sectionService.GetSectionById(id.Value); } var sharedSections = this._sectionService.GetUnconnectedSections(this.CuyahogaContext.CurrentSite); var model = new List<SharedSectionViewData>(); foreach (var sharedSection in sharedSections) { var sharedSectionViewData = new SharedSectionViewData(sharedSection); sharedSectionViewData.AttachedToTemplates = String.Join(", ", this._sectionService.GetTemplatesBySection(sharedSection). Select(t => t.Name).ToArray()); model.Add(sharedSectionViewData); } return View(model); }