Exemplo n.º 1
0
        public Experience Post([FromBody] Experience model)
        {
            // POST: api/User
            // this post method insert the new row or update the current row if there is a record with same ID
            ExperienceDE de    = new ExperienceDE();
            Experience   sonuc = de.AddExperience(model);

            return(sonuc);
        }
Exemplo n.º 2
0
        public IEnumerable <Experience> Get(int id)
        {
            // GET: api/Experience
            //HttpContext.RiseError(new InvalidOperationException("Test"));
            Experience   model = new Experience();
            ExperienceDE de    = new ExperienceDE();

            return(de.GetExperience(id));
        }
Exemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            // DELETE: api/ApiWithActions/5
            ExperienceDE de    = new ExperienceDE();
            bool         sonuc = de.DeleteExperience(id);

            if (sonuc)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Exemplo n.º 4
0
        public IActionResult Put([FromBody] Experience model)
        {
            // POST: api/Experience
            // this post method insert the new row or update the current row if there is a record with same ID
            ExperienceDE de    = new ExperienceDE();
            bool         sonuc = de.UpdateExperience(model);

            if (sonuc)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }