예제 #1
0
        public async Task <bool> AddAsync(core.School School)
        {
            if (await SchoolExists(School.UNITID))
            {
                return(false);
            }
            var newSchool = School.ToDataObject();

            _context.School.Add(newSchool);
            return(_context.ChangeTracker.HasChanges());
        }
예제 #2
0
        public async Task <bool> UpdateAsync(core.School School)
        {
            if (!await SchoolExists(School.UNITID))
            {
                return(false);
            }
            var upSchool = School.ToDataObject();

            _context.School.Update(upSchool);

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