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); }
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); }
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); }