コード例 #1
0
        public ResponseModel Save(Student student)
        {
            using (SchoolManagementDBEntities db = new SchoolManagementDBEntities())
            {
                DbSet<Student> students = db.Students;
                students.Add(student);
                db.SaveChanges();

                return new ResponseModel();
            }
        }
コード例 #2
0
 public bool Post(Student student)
 {
     StudentManager manager = new StudentManager();
     manager.Add(student);
     return true;
 }
コード例 #3
0
 public void Add(Student student)
 {
     DbSet<Student> students = Db.Students;
     students.Add(student);
     Db.SaveChanges();
 }