コード例 #1
0
 public static IObservable <Unit> FromCacheObservable <TObject>(this ISourceList <TObject> sourceList, string cacheKey,
                                                                IEqualityComparer <TObject> comparer)
 {
     return
         (BlobCache.LocalMachine.GetObject <List <TObject> >(cacheKey)
          .Catch(Observable.Return(new List <TObject>()))
          .Do(objects => sourceList.EditDiff(objects, comparer))
          .Select(_ => Unit.Default)
          .Take(1));
 }
コード例 #2
0
        public static async Task FromCache <TObject>(this ISourceList <TObject> sourceList, string cacheKey,
                                                     IEqualityComparer <TObject> comparer)
        {
            var list =
                await
                BlobCache.LocalMachine.GetObject <List <TObject> >(cacheKey)
                .Catch(Observable.Return(new List <TObject>()));

            sourceList.EditDiff(list, comparer);
        }