public List <Candidate> Add(Candidate c)
        {
            var repo = new CandidateRepository(_connectionString);

            repo.Add(c);
            return(repo.GetAll());
        }
 public void Add(Candidate candidate)
 {
     _candidateRepository.Add(candidate);
     if (_candidateList != null)
     {
         _candidateList.Add(candidate);
     }
 }
Exemple #3
0
        public ActionResult <Candidate> PostCandidate(Candidate candidate)
        {
            try
            {
                if (candidate == null)
                {
                    return(BadRequest("Candidato não informado"));
                }

                _repositoryCandidate.Add(candidate);
                _repositoryCandidate.Save();

                return(Ok(candidate));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
                return(BadRequest(ex.Message));
            }
        }
Exemple #4
0
        public void Add(Candidate c)
        {
            var db = new CandidateRepository(_conn);

            db.Add(c);
        }