private IObservable <RedundantCollection <TParam, TResult> > FetchDataAndJoin <TResult, TParam>(Func <IVideoItemsStoreReader, IEnumerable <TParam>, IObservable <IEnumerable <TResult> > > fetchData, Action <IVideoItemsStoreWriter, IEnumerable <TResult> > writeData, RedundantCollection <TParam, TResult> collection) { return(fetchData(_externalStoreReader, collection.OnlyNotJoined) .Where(e => e != null) .Do(e => writeData(_localStoreWriter, e)) .Select(e => collection.JoinIfEmpty(e))); }
public static RedundantCollection <T, TOuter> JoinIfEmpty <T, TOuter>(this RedundantCollection <T, TOuter> redundantCollection, IEnumerable <TOuter> joinedCollection, Func <T, TOuter, bool> joinPredicate = null) { redundantCollection.JoinIfEmpty(joinedCollection, joinPredicate); return(redundantCollection); }