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