Ejemplo n.º 1
0
        /// <summary>
        /// Only used in cache-only mode (no persistence). Can activate Less Recently Used eviction for a data type.
        /// When the <paramref name="limit"/> is reached the less recently used  <paramref name="itemsToRemove"/> items are evicted
        /// </summary>
        /// <param name="evictionType"></param>
        /// <param name="limit"></param>
        /// <param name="itemsToRemove"></param>
        public void ConfigEviction(EvictionType evictionType, int limit, int itemsToRemove = 100)
        {
            if (evictionType == EvictionType.LessRecentlyUsed && limit == 0)
            {
                throw new ArgumentException("If LRU eviction is used, a positive limit must be specified");
            }

            _client.ConfigEviction(typeof(T).FullName, evictionType, limit, itemsToRemove);
        }