コード例 #1
0
        public StudentBatch UpdateStdBatch(StudentBatch _studentBatch)
        {
            var stdBatch = dbContext.StudentBatches.Attach(_studentBatch);

            stdBatch.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            dbContext.SaveChanges();
            return(_studentBatch);
        }
コード例 #2
0
        public StudentBatch RemoveStdBatch(Guid Id)
        {
            StudentBatch studentBatch = dbContext.StudentBatches.Find(Id);

            if (studentBatch != null)
            {
                dbContext.StudentBatches.Remove(studentBatch);
                dbContext.SaveChanges();
            }
            return(studentBatch);
        }
コード例 #3
0
 public StudentBatch AddStdBatch(StudentBatch _studentBatch)
 {
     dbContext.StudentBatches.Add(_studentBatch);
     dbContext.SaveChanges();
     return(_studentBatch);
 }