Esempio n. 1
0
        public static IEnumerable <CacheResult <T> > GetAllEntries <T>([NotNull] this ICacheSection <T> cacheSection)
        {
            cacheSection.AssertArgumentNotNull(nameof(cacheSection));

            var values = cacheSection
                         .Keys
                         .Select(key => cacheSection.GetCacheEntry(key))
                         .Where(cacheResult => !cacheResult.IsEmpty());

            return(values);
        }
Esempio n. 2
0
        public static IEnumerable <ICacheResult> GetAllEntriesUntyped([NotNull] this ICacheSection cacheSection)
        {
            cacheSection.AssertArgumentNotNull(nameof(cacheSection));

            var values = cacheSection
                         .Keys
                         .Select(key => cacheSection.GetCacheEntryUntyped(key))
                         .Where(cacheResult => cacheResult != null);

            return(values);
        }
Esempio n. 3
0
        public static IEnumerable <T> GetAllValues <T>([NotNull] this ICacheSection <T> cacheSection)
        {
            cacheSection.AssertArgumentNotNull(nameof(cacheSection));

            var values = cacheSection
                         .Keys
                         .Select(key => cacheSection.Get(key))
                         .Where(option => option.IsSome)
                         .Select(option => option.GetValueOrDefault());

            return(values);
        }