コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }