Beispiel #1
0
        IEnumerable <EntityWithId <TEntityId, TEntity> > CacheOrClenaup(IEnumerable <EntityWithId <TEntityId, TEntity> > entities)
        {
            foreach (var entity in entities)
            {
                yield return(entity);

                if (_maximumCacheSize == null || _cachedEntities.Count < _maximumCacheSize)
                {
                    AddToDictionary(_cachedEntities, entity);
                }
                else
                {
                    _repository.Cleanup(entity.Entity);
                }
            }
        }
Beispiel #2
0
 public void Cleanup(TEntity entity)
 {
     _decorated.Cleanup(entity);
 }