Example #1
0
        public Keyword Post([FromBody] Keyword model)
        {
            // POST: api/User
            // this post method insert the new row or update the current row if there is a record with same ID
            KeywordDE de    = new KeywordDE();
            Keyword   sonuc = de.AddKeyword(model);

            return(sonuc);
        }
Example #2
0
        public IEnumerable <Keyword> Get(int id)
        {
            // GET: api/Keyword
            //HttpContext.RiseError(new InvalidOperationException("Test"));
            Keyword   model = new Keyword();
            KeywordDE de    = new KeywordDE();

            return(de.GetKeyword(id));
        }
Example #3
0
        public IActionResult Delete(int id)
        {
            // DELETE: api/ApiWithActions/5
            KeywordDE de    = new KeywordDE();
            bool      sonuc = de.DeleteKeyword(id);

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

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