示例#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);
 }