コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
        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());
            }
        }