Exemple #1
0
        public async Task <bool> AddAsync(core.Student Student)
        {
            if (await StudentExists(Student.UNITID))
            {
                return(false);
            }
            var newStudent = Student.ToDataObject();

            _context.Student.Add(newStudent);
            return(_context.ChangeTracker.HasChanges());
        }
Exemple #2
0
        public async Task <bool> UpdateAsync(core.Student Student)
        {
            if (!await StudentExists(Student.UNITID))
            {
                return(false);
            }
            var upStudent = Student.ToDataObject();

            _context.Student.Update(upStudent);

            _context.Update(upStudent);
            return(_context.ChangeTracker.HasChanges());
        }