public ActionResult Details(int id) { var repo = new CandidatesRepository(Properties.Settings.Default.ConStr); var vm = new DetailsViewModel(); vm.Candidate = repo.GetCandidate(id); return(View(vm)); }