public IActionResult Upsert([FromForm] Student student, int id) { // Request.Form.Log(); // student.Log(); var s = classroom.get(id); if (s != null) { classroom.delete(id); } // make sure that the id is the same as student.StudentId = id; classroom.add(student); return(RedirectToAction("ReadAll")); }
public IActionResult Delete(int id) { classroom.delete(id); return(Ok()); }