Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
            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();
            }