public ResponseModel Save(Student student) { using (SchoolManagementDBEntities db = new SchoolManagementDBEntities()) { DbSet<Student> students = db.Students; students.Add(student); db.SaveChanges(); return new ResponseModel(); } }
public bool Post(Student student) { StudentManager manager = new StudentManager(); manager.Add(student); return true; }
public void Add(Student student) { DbSet<Student> students = Db.Students; students.Add(student); Db.SaveChanges(); }