public IEnumerable <Dosen> Get() { DosenRepo dosen = new DosenRepo(); var listDosen = dosen.getAll(); return(listDosen); }
public IActionResult Post([FromBody] Dosen value) { DosenRepo dosen = new DosenRepo(); var temp = dosen.insert(value); return(Ok(temp)); }
public IActionResult Put([FromBody] Dosen value) { DosenRepo dosen = new DosenRepo(); if (dosen.update(value) == true) { return(Ok(value)); } else { var response = new ContentResult() { StatusCode = StatusCodes.Status404NotFound, }; return(response); } }
public IActionResult Get(int id) { DosenRepo dosen = new DosenRepo(); var hasil = dosen.getById(id); if (hasil == null) { var response = new ContentResult() { StatusCode = StatusCodes.Status204NoContent, }; return(response); } else { return(Ok(hasil)); } }
public IActionResult Get() { DosenRepo dosen = new DosenRepo(); var listDosen = dosen.getAll(); if (listDosen == null) { var response = new ContentResult() { StatusCode = StatusCodes.Status204NoContent, }; return(response); } else { return(Ok(listDosen)); } }
public IActionResult Delete(int id) { DosenRepo dosen = new DosenRepo(); Dosen dos = new Dosen(); dos.Id = id; if (dosen.delete(dos) == true) { return(Ok(dos)); } else { var response = new ContentResult() { StatusCode = StatusCodes.Status404NotFound, }; return(response); } }