Пример #1
0
        private static int WithDefault(TimeSpan span)
        {
            var op = new CacheOptions
            {
                CacheName       = nameof(OptionsTests),
                CacheItemExpiry = span,
            };

            op.Initialize();
            return(op.CacheItemExpiryPercentageRandomizationMilliseconds);
        }
Пример #2
0
        private static int WithSpecific(TimeSpan span, int percentage)
        {
            var op = new CacheOptions
            {
                CacheName       = nameof(WithSpecific),
                CacheItemExpiry = span,
                CacheItemExpiryPercentageRandomization = percentage,
            };

            op.Initialize();
            return(op.CacheItemExpiryPercentageRandomizationMilliseconds);
        }