public IActionResult GetKategori() { RepositoryKategori RP = new RepositoryKategori(); try { List <Kategori> List = RP.getAll(); return(Ok(List)); } catch (Exception) { return(NotFound()); } }
public IActionResult PutKategori(String id, [FromBody] Kategori value) { RepositoryKategori RP = new RepositoryKategori(); try { RP.updateData(id, value); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public IActionResult DeleteKategori(String id) { RepositoryKategori RP = new RepositoryKategori(); try { RP.deleteData(id); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public IActionResult PostKategori([FromBody] Kategori value) { RepositoryKategori RP = new RepositoryKategori(); try { RP.insertData(value); return(Created("", value)); } catch (Exception) { return(BadRequest()); } }