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