Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public StudentInBatch AddStudentInBatch(StudentInBatch studentBatch)
 {
     db.student_in_batch.Add(studentBatch);
     db.SaveChanges();
     return(studentBatch);
 }