Ejemplo n.º 1
0
        public void Add(string realmName, IBlacklistEntry blacklistEntry)
        {
            var blacklistEntriesToPersist = _blacklistEntriesGetter.Get(realmName).ToList();
            var entryAlreadyExists        = blacklistEntriesToPersist.Contains(blacklistEntry);

            if (!entryAlreadyExists)
            {
                blacklistEntriesToPersist.Add(blacklistEntry);
            }
            _blacklistEntriesSetter.Set("ns2", blacklistEntriesToPersist);
        }
        public void Remove(string realmName, IBlacklistEntry blacklistEntry)
        {
            var blacklistEntriesToPersist = _blacklistEntriesGetter.Get(realmName).Where(x => !Equals(x, blacklistEntry)).ToList();;

            _blacklistEntriesSetter.Set("ns2", blacklistEntriesToPersist);
        }