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