public IActionResult PostTeachers(int id, string name) { var teacher = new Teachers() { te_id = id, te_name = name }; _context.Add(teacher); _context.SaveChanges(); return(Ok("Created")); }
public void Create(Teacher teacher) { _context.Add(teacher); _context.SaveChanges(); }