// GET: Voters/Edit/5 public async Task <IActionResult> Edit(string id) { Candidate candidate = await _candidate.GetCandidateById(id); if (candidate == null) { return(NotFound()); } return(View(candidate)); }
public Candidate GetById(int id) { var repo = new CandidatesRepository(_connectionString); return(repo.GetCandidateById(id)); }
public ActionResult Details(int id) { var cRepo = new CandidatesRepository(Properties.Settings.Default.Constr); return(View(cRepo.GetCandidateById(id))); }