public bool Delete(int id)
        {
            var user = _context.Users.FirstOrDefault(user => user.Id == id);

            if (user == null)
            {
                return(false);
            }
            _context.Remove(user);
            _context.SaveChanges();
            return(true);
        }
Exemple #2
0
        public bool Delete(int id)
        {
            var School = _context.Schools.FirstOrDefault(School => School.Id == id);

            if (School == null)
            {
                return(false);
            }
            _context.Remove(School);
            _context.SaveChanges();
            return(true);
        }