public Candidate Post([FromBody] Candidate model) { // POST: api/User // this post method insert the new row or update the current row if there is a record with same ID CandidateDE de = new CandidateDE(); Candidate sonuc = de.AddCandidate(model, model.User); return(sonuc); }
public IEnumerable <Candidate> Get(int id) { // GET: api/Candidate //HttpContext.RiseError(new InvalidOperationException("Test")); Candidate model = new Candidate(); CandidateDE de = new CandidateDE(); return(de.GetCandidate(id)); }
public IActionResult Delete(int id) { // DELETE: api/ApiWithActions/5 CandidateDE de = new CandidateDE(); bool sonuc = de.DeleteCandidate(id); if (sonuc) { return(Ok()); } else { return(NotFound()); } }
public IActionResult Put([FromBody] Candidate model) { // POST: api/Candidate // this post method insert the new row or update the current row if there is a record with same ID CandidateDE de = new CandidateDE(); bool sonuc = de.UpdateCandidate(model); if (sonuc) { return(Ok()); } else { return(NotFound()); } }