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 Create([FromBody] Student s) { classroom.add(s); return(Ok()); }