public ActionResult Gallery(string id) { var viewModel = new PortfolioViewModel(); viewModel.Categories = manager.Categories; viewModel.SelectedWork = (from c in viewModel.Categories from w in c.Works where w.Name == id select w).Single(); viewModel.SelectedWork.IsSelected = true; viewModel.SelectedWork.Category.IsSelected = true; return View(viewModel); }
public ActionResult Index() { var viewModel = new PortfolioViewModel(); viewModel.Categories = manager.Categories; return View(viewModel); }