Esempio n. 1
0
        public void RemoveUser(int id)
        {
            if (_context.Users.Find(id) == null)
            {
                throw new NullReferenceException("No user with this Id was found");
            }

            _context.RemoveRange(_context.Users.Find(id));
            _context.SaveChanges();
        }
        public void DeleteMasterPasswordById(int id)
        {
            if (_context.MasterPasswords.Find(id) == null)
            {
                throw new NullReferenceException($"No MasterPassword with the Id of {id} was found");
            }

            _context.RemoveRange(_context.MasterPasswords.Find(id));
            _context.SaveChanges();
        }