public IActionResult Post([FromBody] Matkul value) { MatkulRepo matkul = new MatkulRepo(); var feedback = matkul.insert(value); return(Ok(feedback)); }
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); } }
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); } }