public ActionResult CreateShortcut(int sectionId) { var section = ProjectRepository.Project.ShortcutListSections.Single(scls => scls.SectionId == sectionId); var viewModel = new ShortcutViewModel { Shortcut = new Shortcut(), ParentSectionId = sectionId }; return View("EditShortcut", viewModel); }
public ActionResult EditShortcut(int sectionId, int shortcutId) { var section = ProjectRepository.Project.ShortcutListSections.Single(scls => scls.SectionId == sectionId); var shortcut = section.Shortcuts.Single(sc => sc.ShortcutId == shortcutId); var viewModel = new ShortcutViewModel { Shortcut = shortcut, ParentSectionId = sectionId }; return View(viewModel); }