Exemplo n.º 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());
        }
Exemplo n.º 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());
        }