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