Exemple #1
0
        public IActionResult GetKategori()
        {
            RepositoryKategori RP = new RepositoryKategori();

            try
            {
                List <Kategori> List = RP.getAll();
                return(Ok(List));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
Exemple #2
0
        public IActionResult PutKategori(String id, [FromBody] Kategori value)
        {
            RepositoryKategori RP = new RepositoryKategori();

            try
            {
                RP.updateData(id, value);
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #3
0
        public IActionResult DeleteKategori(String id)
        {
            RepositoryKategori RP = new RepositoryKategori();

            try
            {
                RP.deleteData(id);
                return(Ok());
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
Exemple #4
0
        public IActionResult PostKategori([FromBody] Kategori value)
        {
            RepositoryKategori RP = new RepositoryKategori();

            try
            {
                RP.insertData(value);
                return(Created("", value));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }