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); } }
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)); } }
public void Add(Candidate c) { var db = new CandidateRepository(_conn); db.Add(c); }