コード例 #1
0
        // 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));
        }
コード例 #2
0
        public Candidate GetById(int id)
        {
            var repo = new CandidatesRepository(_connectionString);

            return(repo.GetCandidateById(id));
        }
コード例 #3
0
        public ActionResult Details(int id)
        {
            var cRepo = new CandidatesRepository(Properties.Settings.Default.Constr);

            return(View(cRepo.GetCandidateById(id)));
        }