Example #1
0
        public IActionResult Post([FromBody] Matkul value)
        {
            MatkulRepo matkul   = new MatkulRepo();
            var        feedback = matkul.insert(value);

            return(Ok(feedback));
        }
Example #2
0
        public IActionResult Put([FromBody] Matkul value)
        {
            MatkulRepo matkul = new MatkulRepo();

            if (matkul.update(value) == true)
            {
                return(Ok(value));
            }
            else
            {
                var response = new ContentResult()
                {
                    StatusCode = StatusCodes.Status404NotFound,
                };
                return(response);
            }
        }
Example #3
0
        public IActionResult Delete(int id)
        {
            MatkulRepo matkul = new MatkulRepo();
            Matkul     mat    = new Matkul();

            mat.Id = id;
            if (matkul.delete(mat) == true)
            {
                return(Ok(mat));
            }
            else
            {
                var response = new ContentResult()
                {
                    StatusCode = StatusCodes.Status404NotFound,
                };
                return(response);
            }
        }