コード例 #1
0
        public StudentInBatch UpdateStudentInBatch(StudentInBatch studentBatchChanges)
        {
            var studBatch = db.student_in_batch.Attach(studentBatchChanges);

            studBatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            db.SaveChanges();
            return(studentBatchChanges);
        }
コード例 #2
0
        public StudentInBatch DeleteStudentInBatch(int id)
        {
            StudentInBatch inBatch = db.student_in_batch.Find(id);

            if (inBatch != null)
            {
                db.student_in_batch.Remove(inBatch);
                db.SaveChanges();
            }
            return(inBatch);
        }
コード例 #3
0
 public StudentInBatch AddStudentInBatch(StudentInBatch studentBatch)
 {
     db.student_in_batch.Add(studentBatch);
     db.SaveChanges();
     return(studentBatch);
 }