protected IChangeSet <TDestination, TKey> DoTransform(IChangeSet <TSource, TKey> updates, Func <Change <TSource, TKey>, Optional <TransformResult> > factory) { var transformed = updates.ShouldParallelise(_parallelisationOptions) ? updates.Parallelise(_parallelisationOptions).Select(factory).SelectValues().ToArray() : updates.Select(factory).SelectValues().ToArray(); return(ProcessUpdates(transformed)); }
private IChangeSet <TDestination, TKey> DoTransform(ChangeAwareCache <TDestination, TKey> cache, IChangeSet <TSource, TKey> changes) { var transformed = changes.ShouldParallelise(_parallelisationOptions) ? changes.Parallelise(_parallelisationOptions).Select(ToDestination).ToArray() : changes.Select(ToDestination).ToArray(); return(ProcessUpdates(cache, transformed)); }
protected override IEnumerable<UpdateWithFilter> GetChangesWithFilter(IChangeSet<TObject, TKey> updates) { if (updates.ShouldParallelise(_parallelisationOptions)) { return updates.Parallelise(_parallelisationOptions).Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); } return updates.Select(u => new UpdateWithFilter(Filter(u.Current), u)).ToArray(); }