11 [global::__DynamicallyInvokable]
14 private const string RIGHT_SOURCE_NOT_PARALLEL_STR =
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.";
22 [global::__DynamicallyInvokable]
29 return new ParallelEnumerableWrapper<TSource>(source);
38 [global::__DynamicallyInvokable]
45 return new PartitionerQueryOperator<TSource>(source);
55 [global::__DynamicallyInvokable]
62 if (!(source is ParallelEnumerableWrapper<TSource>) && !(source is IParallelPartitionable<TSource>))
64 PartitionerQueryOperator<TSource> partitionerQueryOperator = source as PartitionerQueryOperator<TSource>;
65 if (partitionerQueryOperator ==
null)
69 if (!partitionerQueryOperator.Orderable)
74 return new OrderingQueryOperator<TSource>(QueryOperator<TSource>.AsQueryOperator(source), orderOn:
true);
83 [global::__DynamicallyInvokable]
90 ParallelEnumerableWrapper parallelEnumerableWrapper = source as ParallelEnumerableWrapper;
91 if (parallelEnumerableWrapper ==
null)
95 return new OrderingQueryOperator<object>(QueryOperator<object>.AsQueryOperator(parallelEnumerableWrapper), orderOn:
true);
104 [global::__DynamicallyInvokable]
111 return new OrderingQueryOperator<TSource>(QueryOperator<TSource>.AsQueryOperator(source), orderOn:
false);
119 [global::__DynamicallyInvokable]
126 return new ParallelEnumerableWrapper(source);
135 [global::__DynamicallyInvokable]
142 ParallelEnumerableWrapper<TSource> parallelEnumerableWrapper = source as ParallelEnumerableWrapper<TSource>;
143 if (parallelEnumerableWrapper !=
null)
145 return parallelEnumerableWrapper.WrappedEnumerable;
156 if (taskScheduler ==
null)
160 QuerySettings empty = QuerySettings.Empty;
161 empty.TaskScheduler = taskScheduler;
162 return new QueryExecutionOption<TSource>(QueryOperator<TSource>.AsQueryOperator(source), empty);
175 [global::__DynamicallyInvokable]
182 if (degreeOfParallelism < 1 || degreeOfParallelism > 512)
186 QuerySettings empty = QuerySettings.Empty;
187 empty.DegreeOfParallelism = degreeOfParallelism;
188 return new QueryExecutionOption<TSource>(QueryOperator<TSource>.AsQueryOperator(source), empty);
201 [global::__DynamicallyInvokable]
211 cancellationTokenRegistration = cancellationToken.
Register(delegate
217 throw new ArgumentException(SR.GetString(
"ParallelEnumerable_WithCancellation_TokenSourceDisposed"),
"cancellationToken");
221 cancellationTokenRegistration.
Dispose();
223 QuerySettings empty = QuerySettings.Empty;
224 empty.CancellationState =
new CancellationState(cancellationToken);
225 return new QueryExecutionOption<TSource>(QueryOperator<TSource>.AsQueryOperator(source), empty);
238 [global::__DynamicallyInvokable]
247 throw new ArgumentException(SR.GetString(
"ParallelEnumerable_WithQueryExecutionMode_InvalidMode"));
249 QuerySettings empty = QuerySettings.Empty;
250 empty.ExecutionMode = executionMode;
251 return new QueryExecutionOption<TSource>(QueryOperator<TSource>.AsQueryOperator(source), empty);
265 [global::__DynamicallyInvokable]
274 throw new ArgumentException(SR.GetString(
"ParallelEnumerable_WithMergeOptions_InvalidOptions"));
276 QuerySettings empty = QuerySettings.Empty;
277 empty.MergeOptions = mergeOptions;
278 return new QueryExecutionOption<TSource>(QueryOperator<TSource>.AsQueryOperator(source), empty);
287 [global::__DynamicallyInvokable]
290 if (count < 0 || (count > 0 &&
int.MaxValue - (count - 1) < start))
294 return new RangeEnumerable(start, count);
304 [global::__DynamicallyInvokable]
311 return new RepeatEnumerable<TResult>(element, count);
317 [global::__DynamicallyInvokable]
331 [global::__DynamicallyInvokable]
342 new ForAllOperator<TSource>(source, action).RunSynchronously();
354 [global::__DynamicallyInvokable]
361 if (predicate ==
null)
365 return new WhereQueryOperator<TSource>(source, predicate);
378 [global::__DynamicallyInvokable]
385 if (predicate ==
null)
389 return new IndexedWhereQueryOperator<TSource>(source, predicate);
402 [global::__DynamicallyInvokable]
409 if (selector ==
null)
413 return new SelectQueryOperator<TSource, TResult>(source, selector);
427 [global::__DynamicallyInvokable]
434 if (selector ==
null)
438 return new IndexedSelectQueryOperator<TSource, TResult>(source, selector);
453 [global::__DynamicallyInvokable]
464 if (resultSelector ==
null)
468 return new ZipQueryOperator<TFirst, TSecond, TResult>(first, second, resultSelector);
480 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
481 [global::__DynamicallyInvokable]
502 [global::__DynamicallyInvokable]
503 public static ParallelQuery<TResult> Join<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
ParallelQuery<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector)
505 return outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector,
null);
523 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
524 [global::__DynamicallyInvokable]
525 public static ParallelQuery<TResult> Join<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector)
546 [global::__DynamicallyInvokable]
547 public static ParallelQuery<TResult> Join<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
ParallelQuery<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
557 if (outerKeySelector ==
null)
561 if (innerKeySelector ==
null)
565 if (resultSelector ==
null)
569 return new JoinQueryOperator<TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer);
585 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
586 [global::__DynamicallyInvokable]
587 public static ParallelQuery<TResult> Join<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter, TInner, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
607 [global::__DynamicallyInvokable]
608 public static ParallelQuery<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
ParallelQuery<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter,
IEnumerable<TInner>, TResult> resultSelector)
610 return outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector,
null);
628 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
629 [global::__DynamicallyInvokable]
630 public static ParallelQuery<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter,
IEnumerable<TInner>, TResult> resultSelector)
651 [global::__DynamicallyInvokable]
652 public static ParallelQuery<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
ParallelQuery<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter,
IEnumerable<TInner>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
662 if (outerKeySelector ==
null)
666 if (innerKeySelector ==
null)
670 if (resultSelector ==
null)
674 return new GroupJoinQueryOperator<TOuter, TInner, TKey, TResult>(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer);
690 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
691 [global::__DynamicallyInvokable]
692 public static ParallelQuery<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(
this ParallelQuery<TOuter> outer,
IEnumerable<TInner> inner, Func<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector, Func<TOuter,
IEnumerable<TInner>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
707 [global::__DynamicallyInvokable]
714 if (selector ==
null)
718 return new SelectManyQueryOperator<TSource, TResult, TResult>(source, selector,
null,
null);
732 [global::__DynamicallyInvokable]
739 if (selector ==
null)
743 return new SelectManyQueryOperator<TSource, TResult, TResult>(source,
null, selector,
null);
759 [global::__DynamicallyInvokable]
766 if (collectionSelector ==
null)
770 if (resultSelector ==
null)
774 return new SelectManyQueryOperator<TSource, TCollection, TResult>(source, collectionSelector,
null, resultSelector);
790 [global::__DynamicallyInvokable]
797 if (collectionSelector ==
null)
801 if (resultSelector ==
null)
805 return new SelectManyQueryOperator<TSource, TCollection, TResult>(source,
null, collectionSelector, resultSelector);
818 [global::__DynamicallyInvokable]
825 if (keySelector ==
null)
843 [global::__DynamicallyInvokable]
850 if (keySelector ==
null)
867 [global::__DynamicallyInvokable]
874 if (keySelector ==
null)
892 [global::__DynamicallyInvokable]
899 if (keySelector ==
null)
916 [global::__DynamicallyInvokable]
923 if (keySelector ==
null)
927 return new OrderedParallelQuery<TSource>((QueryOperator<TSource>)source.OrderedEnumerable.CreateOrderedEnumerable(keySelector,
null, descending:
false));
941 [global::__DynamicallyInvokable]
948 if (keySelector ==
null)
952 return new OrderedParallelQuery<TSource>((QueryOperator<TSource>)source.OrderedEnumerable.CreateOrderedEnumerable(keySelector, comparer, descending:
false));
965 [global::__DynamicallyInvokable]
972 if (keySelector ==
null)
976 return new OrderedParallelQuery<TSource>((QueryOperator<TSource>)source.OrderedEnumerable.CreateOrderedEnumerable(keySelector,
null, descending:
true));
990 [global::__DynamicallyInvokable]
997 if (keySelector ==
null)
1001 return new OrderedParallelQuery<TSource>((QueryOperator<TSource>)source.OrderedEnumerable.CreateOrderedEnumerable(keySelector, comparer, descending:
true));
1014 [global::__DynamicallyInvokable]
1017 return source.GroupBy(keySelector,
null);
1031 [global::__DynamicallyInvokable]
1038 if (keySelector ==
null)
1042 return new GroupByQueryOperator<TSource, TKey, TSource>(source, keySelector,
null, comparer);
1057 [global::__DynamicallyInvokable]
1060 return source.GroupBy(keySelector, elementSelector,
null);
1076 [global::__DynamicallyInvokable]
1083 if (keySelector ==
null)
1087 if (elementSelector ==
null)
1091 return new GroupByQueryOperator<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer);
1106 [global::__DynamicallyInvokable]
1109 if (resultSelector ==
null)
1113 return from grouping in source.GroupBy(keySelector)
1114 select resultSelector(grouping.Key, grouping);
1130 [global::__DynamicallyInvokable]
1133 if (resultSelector ==
null)
1137 return from grouping in source.GroupBy(keySelector, comparer)
1138 select resultSelector(grouping.Key, grouping);
1155 [global::__DynamicallyInvokable]
1156 public static ParallelQuery<TResult> GroupBy<TSource, TKey, TElement, TResult>(
this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey,
IEnumerable<TElement>, TResult> resultSelector)
1158 if (resultSelector ==
null)
1162 return from grouping in source.GroupBy(keySelector, elementSelector)
1163 select resultSelector(grouping.Key, grouping);
1181 [global::__DynamicallyInvokable]
1182 public static ParallelQuery<TResult> GroupBy<TSource, TKey, TElement, TResult>(
this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, Func<TKey,
IEnumerable<TElement>, TResult> resultSelector,
IEqualityComparer<TKey> comparer)
1184 if (resultSelector ==
null)
1188 return from grouping in source.GroupBy(keySelector, elementSelector, comparer)
1189 select resultSelector(grouping.Key, grouping);
1192 private static T PerformAggregation<T>(
this ParallelQuery<T> source, Func<T, T, T> reduce, T seed,
bool seedIsSpecified,
bool throwIfEmpty, QueryAggregationOptions options)
1194 AssociativeAggregationOperator<T, T, T> associativeAggregationOperator =
new AssociativeAggregationOperator<T, T, T>(source, seed,
null, seedIsSpecified, reduce, reduce, (T obj) => obj, throwIfEmpty, options);
1195 return associativeAggregationOperator.Aggregate();
1198 private static TAccumulate PerformSequentialAggregation<TSource, TAccumulate>(
this ParallelQuery<TSource> source, TAccumulate seed,
bool seedIsSpecified, Func<TAccumulate, TSource, TAccumulate> func)
1203 if (seedIsSpecified)
1211 throw new InvalidOperationException(SR.GetString(
"NoElements"));
1213 val = (TAccumulate)(
object)enumerator.
Current;
1217 TSource current = enumerator.
Current;
1220 val = func(val, current);
1226 catch (Exception ex2)
1228 throw new AggregateException(ex2);
1246 [global::__DynamicallyInvokable]
1249 return source.Aggregate(func, QueryAggregationOptions.AssociativeCommutative);
1262 if ((~(QueryAggregationOptions.Associative | QueryAggregationOptions.Commutative) & options) != 0)
1264 throw new ArgumentOutOfRangeException(
"options");
1266 if ((options & QueryAggregationOptions.Associative) != QueryAggregationOptions.Associative)
1268 return source.PerformSequentialAggregation(
default(TSource), seedIsSpecified:
false, func);
1270 return source.PerformAggregation(func,
default(TSource), seedIsSpecified:
false, throwIfEmpty:
true, options);
1286 [global::__DynamicallyInvokable]
1289 return source.Aggregate(seed, func, QueryAggregationOptions.AssociativeCommutative);
1302 if ((~(QueryAggregationOptions.Associative | QueryAggregationOptions.Commutative) & options) != 0)
1304 throw new ArgumentOutOfRangeException(
"options");
1306 return source.PerformSequentialAggregation(seed, seedIsSpecified:
true, func);
1324 [global::__DynamicallyInvokable]
1335 if (resultSelector ==
null)
1339 TAccumulate arg = source.PerformSequentialAggregation(seed, seedIsSpecified:
true, func);
1342 return resultSelector(arg);
1370 [global::__DynamicallyInvokable]
1371 public static TResult
Aggregate<TSource, TAccumulate, TResult>(
this ParallelQuery<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc, Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc, Func<TAccumulate, TResult> resultSelector)
1377 if (updateAccumulatorFunc ==
null)
1381 if (combineAccumulatorsFunc ==
null)
1385 if (resultSelector ==
null)
1389 return new AssociativeAggregationOperator<TSource, TAccumulate, TResult>(source, seed,
null, seedIsSpecified:
true, updateAccumulatorFunc, combineAccumulatorsFunc, resultSelector, throwIfEmpty:
false, QueryAggregationOptions.AssociativeCommutative).Aggregate();
1408 [global::__DynamicallyInvokable]
1409 public static TResult
Aggregate<TSource, TAccumulate, TResult>(
this ParallelQuery<TSource> source, Func<TAccumulate> seedFactory, Func<TAccumulate, TSource, TAccumulate> updateAccumulatorFunc, Func<TAccumulate, TAccumulate, TAccumulate> combineAccumulatorsFunc, Func<TAccumulate, TResult> resultSelector)
1415 if (seedFactory ==
null)
1419 if (updateAccumulatorFunc ==
null)
1423 if (combineAccumulatorsFunc ==
null)
1427 if (resultSelector ==
null)
1431 return new AssociativeAggregationOperator<TSource, TAccumulate, TResult>(source,
default(TAccumulate), seedFactory, seedIsSpecified:
true, updateAccumulatorFunc, combineAccumulatorsFunc, resultSelector, throwIfEmpty:
false, QueryAggregationOptions.AssociativeCommutative).Aggregate();
1442 [global::__DynamicallyInvokable]
1449 ParallelEnumerableWrapper<TSource> parallelEnumerableWrapper = source as ParallelEnumerableWrapper<TSource>;
1450 if (parallelEnumerableWrapper !=
null)
1453 if (collection !=
null)
1455 return collection.Count;
1458 return new CountAggregationOperator<TSource>(source).Aggregate();
1470 [global::__DynamicallyInvokable]
1477 if (predicate ==
null)
1481 return new CountAggregationOperator<TSource>(source.Where(predicate)).Aggregate();
1493 [global::__DynamicallyInvokable]
1500 ParallelEnumerableWrapper<TSource> parallelEnumerableWrapper = source as ParallelEnumerableWrapper<TSource>;
1501 if (parallelEnumerableWrapper !=
null)
1504 if (collection !=
null)
1506 return collection.Count;
1509 return new LongCountAggregationOperator<TSource>(source).Aggregate();
1522 [global::__DynamicallyInvokable]
1529 if (predicate ==
null)
1533 return new LongCountAggregationOperator<TSource>(source.Where(predicate)).Aggregate();
1543 [global::__DynamicallyInvokable]
1550 return new IntSumAggregationOperator(source).Aggregate();
1560 [global::__DynamicallyInvokable]
1567 return new NullableIntSumAggregationOperator(source).Aggregate();
1577 [global::__DynamicallyInvokable]
1584 return new LongSumAggregationOperator(source).Aggregate();
1594 [global::__DynamicallyInvokable]
1601 return new NullableLongSumAggregationOperator(source).Aggregate();
1611 [global::__DynamicallyInvokable]
1618 return new FloatSumAggregationOperator(source).Aggregate();
1628 [global::__DynamicallyInvokable]
1635 return new NullableFloatSumAggregationOperator(source).Aggregate();
1645 [global::__DynamicallyInvokable]
1652 return new DoubleSumAggregationOperator(source).Aggregate();
1662 [global::__DynamicallyInvokable]
1669 return new NullableDoubleSumAggregationOperator(source).Aggregate();
1679 [global::__DynamicallyInvokable]
1686 return new DecimalSumAggregationOperator(source).Aggregate();
1696 [global::__DynamicallyInvokable]
1703 return new NullableDecimalSumAggregationOperator(source).Aggregate();
1715 [global::__DynamicallyInvokable]
1718 return source.Select(selector).Sum();
1730 [global::__DynamicallyInvokable]
1733 return source.Select(selector).Sum();
1745 [global::__DynamicallyInvokable]
1748 return source.Select(selector).Sum();
1760 [global::__DynamicallyInvokable]
1763 return source.Select(selector).Sum();
1775 [global::__DynamicallyInvokable]
1778 return source.Select(selector).Sum();
1790 [global::__DynamicallyInvokable]
1793 return source.Select(selector).Sum();
1805 [global::__DynamicallyInvokable]
1808 return source.Select(selector).Sum();
1820 [global::__DynamicallyInvokable]
1823 return source.Select(selector).Sum();
1835 [global::__DynamicallyInvokable]
1838 return source.Select(selector).Sum();
1850 [global::__DynamicallyInvokable]
1853 return source.Select(selector).Sum();
1865 [global::__DynamicallyInvokable]
1872 return new IntMinMaxAggregationOperator(source, -1).Aggregate();
1884 [global::__DynamicallyInvokable]
1891 return new NullableIntMinMaxAggregationOperator(source, -1).Aggregate();
1903 [global::__DynamicallyInvokable]
1910 return new LongMinMaxAggregationOperator(source, -1).Aggregate();
1922 [global::__DynamicallyInvokable]
1929 return new NullableLongMinMaxAggregationOperator(source, -1).Aggregate();
1941 [global::__DynamicallyInvokable]
1948 return new FloatMinMaxAggregationOperator(source, -1).Aggregate();
1960 [global::__DynamicallyInvokable]
1967 return new NullableFloatMinMaxAggregationOperator(source, -1).Aggregate();
1979 [global::__DynamicallyInvokable]
1986 return new DoubleMinMaxAggregationOperator(source, -1).Aggregate();
1998 [global::__DynamicallyInvokable]
2005 return new NullableDoubleMinMaxAggregationOperator(source, -1).Aggregate();
2017 [global::__DynamicallyInvokable]
2024 return new DecimalMinMaxAggregationOperator(source, -1).Aggregate();
2036 [global::__DynamicallyInvokable]
2043 return new NullableDecimalMinMaxAggregationOperator(source, -1).Aggregate();
2056 [global::__DynamicallyInvokable]
2063 return AggregationMinMaxHelpers<TSource>.ReduceMin(source);
2077 [global::__DynamicallyInvokable]
2080 return source.Select(selector).Min<
int>();
2094 [global::__DynamicallyInvokable]
2097 return source.Select(selector).Min<
int?>();
2111 [global::__DynamicallyInvokable]
2114 return source.Select(selector).Min<
long>();
2128 [global::__DynamicallyInvokable]
2131 return source.Select(selector).Min<
long?>();
2145 [global::__DynamicallyInvokable]
2148 return source.Select(selector).Min<
float>();
2162 [global::__DynamicallyInvokable]
2165 return source.Select(selector).Min<
float?>();
2179 [global::__DynamicallyInvokable]
2182 return source.Select(selector).Min<
double>();
2196 [global::__DynamicallyInvokable]
2199 return source.Select(selector).Min<
double?>();
2213 [global::__DynamicallyInvokable]
2216 return source.Select(selector).Min<decimal>();
2230 [global::__DynamicallyInvokable]
2233 return source.Select(selector).Min<decimal?>();
2248 [global::__DynamicallyInvokable]
2251 return source.Select(selector).Min();
2263 [global::__DynamicallyInvokable]
2270 return new IntMinMaxAggregationOperator(source, 1).Aggregate();
2282 [global::__DynamicallyInvokable]
2289 return new NullableIntMinMaxAggregationOperator(source, 1).Aggregate();
2301 [global::__DynamicallyInvokable]
2308 return new LongMinMaxAggregationOperator(source, 1).Aggregate();
2320 [global::__DynamicallyInvokable]
2327 return new NullableLongMinMaxAggregationOperator(source, 1).Aggregate();
2339 [global::__DynamicallyInvokable]
2346 return new FloatMinMaxAggregationOperator(source, 1).Aggregate();
2358 [global::__DynamicallyInvokable]
2365 return new NullableFloatMinMaxAggregationOperator(source, 1).Aggregate();
2377 [global::__DynamicallyInvokable]
2384 return new DoubleMinMaxAggregationOperator(source, 1).Aggregate();
2396 [global::__DynamicallyInvokable]
2403 return new NullableDoubleMinMaxAggregationOperator(source, 1).Aggregate();
2415 [global::__DynamicallyInvokable]
2422 return new DecimalMinMaxAggregationOperator(source, 1).Aggregate();
2434 [global::__DynamicallyInvokable]
2441 return new NullableDecimalMinMaxAggregationOperator(source, 1).Aggregate();
2454 [global::__DynamicallyInvokable]
2461 return AggregationMinMaxHelpers<TSource>.ReduceMax(source);
2475 [global::__DynamicallyInvokable]
2478 return source.Select(selector).Max<
int>();
2492 [global::__DynamicallyInvokable]
2495 return source.Select(selector).Max<
int?>();
2509 [global::__DynamicallyInvokable]
2512 return source.Select(selector).Max<
long>();
2526 [global::__DynamicallyInvokable]
2529 return source.Select(selector).Max<
long?>();
2543 [global::__DynamicallyInvokable]
2546 return source.Select(selector).Max<
float>();
2560 [global::__DynamicallyInvokable]
2563 return source.Select(selector).Max<
float?>();
2577 [global::__DynamicallyInvokable]
2580 return source.Select(selector).Max<
double>();
2594 [global::__DynamicallyInvokable]
2597 return source.Select(selector).Max<
double?>();
2611 [global::__DynamicallyInvokable]
2614 return source.Select(selector).Max<decimal>();
2628 [global::__DynamicallyInvokable]
2631 return source.Select(selector).Max<decimal?>();
2646 [global::__DynamicallyInvokable]
2649 return source.Select(selector).Max();
2661 [global::__DynamicallyInvokable]
2668 return new IntAverageAggregationOperator(source).Aggregate();
2680 [global::__DynamicallyInvokable]
2687 return new NullableIntAverageAggregationOperator(source).Aggregate();
2699 [global::__DynamicallyInvokable]
2706 return new LongAverageAggregationOperator(source).Aggregate();
2718 [global::__DynamicallyInvokable]
2725 return new NullableLongAverageAggregationOperator(source).Aggregate();
2737 [global::__DynamicallyInvokable]
2744 return new FloatAverageAggregationOperator(source).Aggregate();
2756 [global::__DynamicallyInvokable]
2763 return new NullableFloatAverageAggregationOperator(source).Aggregate();
2775 [global::__DynamicallyInvokable]
2782 return new DoubleAverageAggregationOperator(source).Aggregate();
2793 [global::__DynamicallyInvokable]
2800 return new NullableDoubleAverageAggregationOperator(source).Aggregate();
2812 [global::__DynamicallyInvokable]
2819 return new DecimalAverageAggregationOperator(source).Aggregate();
2831 [global::__DynamicallyInvokable]
2838 return new NullableDecimalAverageAggregationOperator(source).Aggregate();
2853 [global::__DynamicallyInvokable]
2856 return source.Select(selector).Average();
2871 [global::__DynamicallyInvokable]
2874 return source.Select(selector).Average();
2889 [global::__DynamicallyInvokable]
2892 return source.Select(selector).Average();
2907 [global::__DynamicallyInvokable]
2910 return source.Select(selector).Average();
2925 [global::__DynamicallyInvokable]
2928 return source.Select(selector).Average();
2943 [global::__DynamicallyInvokable]
2946 return source.Select(selector).Average();
2961 [global::__DynamicallyInvokable]
2964 return source.Select(selector).Average();
2979 [global::__DynamicallyInvokable]
2982 return source.Select(selector).Average();
2997 [global::__DynamicallyInvokable]
3000 return source.Select(selector).Average();
3015 [global::__DynamicallyInvokable]
3018 return source.Select(selector).Average();
3030 [global::__DynamicallyInvokable]
3037 if (predicate ==
null)
3041 return new AnyAllSearchOperator<TSource>(source, qualification:
true, predicate).Aggregate();
3052 [global::__DynamicallyInvokable]
3059 return source.Any((TSource x) =>
true);
3071 [global::__DynamicallyInvokable]
3078 if (predicate ==
null)
3082 return new AnyAllSearchOperator<TSource>(source, qualification:
false, predicate).Aggregate();
3094 [global::__DynamicallyInvokable]
3097 return source.Contains(value,
null);
3110 [global::__DynamicallyInvokable]
3117 return new ContainsSearchOperator<TSource>(source, value, comparer).Aggregate();
3129 [global::__DynamicallyInvokable]
3138 return new TakeOrSkipQueryOperator<TSource>(source, count, take:
true);
3140 return Empty<TSource>();
3152 [global::__DynamicallyInvokable]
3159 if (predicate ==
null)
3163 return new TakeOrSkipWhileQueryOperator<TSource>(source, predicate,
null, take:
true);
3176 [global::__DynamicallyInvokable]
3183 if (predicate ==
null)
3187 return new TakeOrSkipWhileQueryOperator<TSource>(source,
null, predicate, take:
true);
3200 [global::__DynamicallyInvokable]
3211 return new TakeOrSkipQueryOperator<TSource>(source, count, take:
false);
3223 [global::__DynamicallyInvokable]
3230 if (predicate ==
null)
3234 return new TakeOrSkipWhileQueryOperator<TSource>(source, predicate,
null, take:
false);
3247 [global::__DynamicallyInvokable]
3254 if (predicate ==
null)
3258 return new TakeOrSkipWhileQueryOperator<TSource>(source,
null, predicate, take:
false);
3268 [global::__DynamicallyInvokable]
3279 return new ConcatQueryOperator<TSource>(first, second);
3288 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3289 [global::__DynamicallyInvokable]
3304 [global::__DynamicallyInvokable]
3315 return first.SequenceEqual(second,
null);
3324 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3325 [global::__DynamicallyInvokable]
3341 [global::__DynamicallyInvokable]
3353 QueryOperator<TSource> queryOperator = QueryOperator<TSource>.AsQueryOperator(first);
3354 QueryOperator<TSource> queryOperator2 = QueryOperator<TSource>.AsQueryOperator(second);
3355 QuerySettings querySettings = queryOperator.SpecifiedQuerySettings.Merge(queryOperator2.SpecifiedQuerySettings).WithDefaults().WithPerExecutionSettings(
new CancellationTokenSource(),
new System.
Linq.
Parallel.
Shared<
bool>(value:
false));
3380 ExceptionAggregator.ThrowOCEorAggregateException(ex2, querySettings.CancellationState);
3384 DisposeEnumerator(enumerator2, querySettings.CancellationState);
3389 DisposeEnumerator(enumerator, querySettings.CancellationState);
3394 private static void DisposeEnumerator<TSource>(
IEnumerator<TSource> e, CancellationState cancelState)
3404 catch (Exception ex2)
3406 ExceptionAggregator.ThrowOCEorAggregateException(ex2, cancelState);
3417 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3418 [global::__DynamicallyInvokable]
3432 [global::__DynamicallyInvokable]
3435 return source.Distinct(
null);
3446 [global::__DynamicallyInvokable]
3453 return new DistinctQueryOperator<TSource>(source, comparer);
3465 [global::__DynamicallyInvokable]
3468 return first.Union(second,
null);
3479 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3480 [global::__DynamicallyInvokable]
3496 [global::__DynamicallyInvokable]
3507 return new UnionQueryOperator<TSource>(first, second, comparer);
3519 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3520 [global::__DynamicallyInvokable]
3535 [global::__DynamicallyInvokable]
3538 return first.Intersect(second,
null);
3547 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3548 [global::__DynamicallyInvokable]
3564 [global::__DynamicallyInvokable]
3575 return new IntersectQueryOperator<TSource>(first, second, comparer);
3585 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3586 [global::__DynamicallyInvokable]
3601 [global::__DynamicallyInvokable]
3604 return first.Except(second,
null);
3613 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3614 [global::__DynamicallyInvokable]
3631 [global::__DynamicallyInvokable]
3642 return new ExceptQueryOperator<TSource>(first, second, comparer);
3652 [Obsolete(
"The second data source of a binary operator must be of type System.Linq.ParallelQuery<T> rather than System.Collections.Generic.IEnumerable<T>. To fix this problem, use the AsParallel() extension method to convert the right data source to System.Linq.ParallelQuery<T>.")]
3653 [global::__DynamicallyInvokable]
3665 [global::__DynamicallyInvokable]
3668 return source.AsSequential();
3679 [global::__DynamicallyInvokable]
3686 QueryOperator<TSource> queryOperator = source as QueryOperator<TSource>;
3687 if (queryOperator !=
null)
3689 return queryOperator.ExecuteAndGetResultsAsArray();
3702 [global::__DynamicallyInvokable]
3710 QueryOperator<TSource> queryOperator = source as QueryOperator<TSource>;
3712 if (queryOperator !=
null)
3714 if (queryOperator.OrdinalIndexState == OrdinalIndexState.Indexible && queryOperator.OutputOrdered)
3722 enumerator = source.GetEnumerator();
3745 [global::__DynamicallyInvokable]
3763 [global::__DynamicallyInvokable]
3770 if (keySelector ==
null)
3775 QueryOperator<TSource> queryOperator = source as QueryOperator<TSource>;
3781 TSource current = enumerator.
Current;
3784 TKey key = keySelector(current);
3785 dictionary.Add(key, current);
3813 [global::__DynamicallyInvokable]
3833 [global::__DynamicallyInvokable]
3840 if (keySelector ==
null)
3844 if (elementSelector ==
null)
3849 QueryOperator<TSource> queryOperator = source as QueryOperator<TSource>;
3855 TSource current = enumerator.
Current;
3858 dictionary.Add(keySelector(current), elementSelector(current));
3883 [global::__DynamicallyInvokable]
3900 [global::__DynamicallyInvokable]
3907 if (keySelector ==
null)
3914 QueryOperator<IGrouping<TKey, TSource>> queryOperator = parallelQuery as QueryOperator<IGrouping<TKey, TSource>>;
3920 lookup.Add(enumerator.
Current);
3938 [global::__DynamicallyInvokable]
3957 [global::__DynamicallyInvokable]
3964 if (keySelector ==
null)
3968 if (elementSelector ==
null)
3975 QueryOperator<IGrouping<TKey, TElement>> queryOperator = parallelQuery as QueryOperator<IGrouping<TKey, TElement>>;
3981 lookup.Add(enumerator.
Current);
3995 [global::__DynamicallyInvokable]
4002 return new ReverseQueryOperator<TSource>(source);
4013 [global::__DynamicallyInvokable]
4020 return source.OfType<TResult>();
4030 [global::__DynamicallyInvokable]
4033 return source.Cast<TResult>();
4036 private static TSource GetOneWithPossibleDefault<TSource>(QueryOperator<TSource> queryOp,
bool throwIfTwo,
bool defaultIfEmpty)
4042 TSource current = enumerator.
Current;
4043 if (throwIfTwo && enumerator.
MoveNext())
4052 return default(TSource);
4054 throw new InvalidOperationException(SR.GetString(
"NoElements"));
4067 [global::__DynamicallyInvokable]
4074 FirstQueryOperator<TSource> firstQueryOperator =
new FirstQueryOperator<TSource>(source,
null);
4075 QuerySettings querySettings = firstQueryOperator.SpecifiedQuerySettings.WithDefaults();
4076 if (firstQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4078 IEnumerable<TSource> source2 = firstQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4079 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4080 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).First();
4082 return GetOneWithPossibleDefault(firstQueryOperator, throwIfTwo:
false, defaultIfEmpty:
false);
4095 [global::__DynamicallyInvokable]
4102 if (predicate ==
null)
4106 FirstQueryOperator<TSource> firstQueryOperator =
new FirstQueryOperator<TSource>(source, predicate);
4107 QuerySettings querySettings = firstQueryOperator.SpecifiedQuerySettings.WithDefaults();
4108 if (firstQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4110 IEnumerable<TSource> source2 = firstQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4111 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4112 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).First(ExceptionAggregator.WrapFunc(predicate, querySettings.CancellationState));
4114 return GetOneWithPossibleDefault(firstQueryOperator, throwIfTwo:
false, defaultIfEmpty:
false);
4125 [global::__DynamicallyInvokable]
4132 FirstQueryOperator<TSource> firstQueryOperator =
new FirstQueryOperator<TSource>(source,
null);
4133 QuerySettings querySettings = firstQueryOperator.SpecifiedQuerySettings.WithDefaults();
4134 if (firstQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4136 IEnumerable<TSource> source2 = firstQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4137 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4138 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).FirstOrDefault();
4140 return GetOneWithPossibleDefault(firstQueryOperator, throwIfTwo:
false, defaultIfEmpty:
true);
4152 [global::__DynamicallyInvokable]
4159 if (predicate ==
null)
4163 FirstQueryOperator<TSource> firstQueryOperator =
new FirstQueryOperator<TSource>(source, predicate);
4164 QuerySettings querySettings = firstQueryOperator.SpecifiedQuerySettings.WithDefaults();
4165 if (firstQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4167 IEnumerable<TSource> source2 = firstQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4168 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4169 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).FirstOrDefault(ExceptionAggregator.WrapFunc(predicate, querySettings.CancellationState));
4171 return GetOneWithPossibleDefault(firstQueryOperator, throwIfTwo:
false, defaultIfEmpty:
true);
4184 [global::__DynamicallyInvokable]
4191 LastQueryOperator<TSource> lastQueryOperator =
new LastQueryOperator<TSource>(source,
null);
4192 QuerySettings querySettings = lastQueryOperator.SpecifiedQuerySettings.WithDefaults();
4193 if (lastQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4195 IEnumerable<TSource> source2 = lastQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4196 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4197 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).Last();
4199 return GetOneWithPossibleDefault(lastQueryOperator, throwIfTwo:
false, defaultIfEmpty:
false);
4212 [global::__DynamicallyInvokable]
4219 if (predicate ==
null)
4223 LastQueryOperator<TSource> lastQueryOperator =
new LastQueryOperator<TSource>(source, predicate);
4224 QuerySettings querySettings = lastQueryOperator.SpecifiedQuerySettings.WithDefaults();
4225 if (lastQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4227 IEnumerable<TSource> source2 = lastQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4228 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4229 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).Last(ExceptionAggregator.WrapFunc(predicate, querySettings.CancellationState));
4231 return GetOneWithPossibleDefault(lastQueryOperator, throwIfTwo:
false, defaultIfEmpty:
false);
4242 [global::__DynamicallyInvokable]
4249 LastQueryOperator<TSource> lastQueryOperator =
new LastQueryOperator<TSource>(source,
null);
4250 QuerySettings querySettings = lastQueryOperator.SpecifiedQuerySettings.WithDefaults();
4251 if (lastQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4253 IEnumerable<TSource> source2 = lastQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4254 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4255 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).LastOrDefault();
4257 return GetOneWithPossibleDefault(lastQueryOperator, throwIfTwo:
false, defaultIfEmpty:
true);
4269 [global::__DynamicallyInvokable]
4276 if (predicate ==
null)
4280 LastQueryOperator<TSource> lastQueryOperator =
new LastQueryOperator<TSource>(source, predicate);
4281 QuerySettings querySettings = lastQueryOperator.SpecifiedQuerySettings.WithDefaults();
4282 if (lastQueryOperator.LimitsParallelism && querySettings.ExecutionMode !=
ParallelExecutionMode.ForceParallelism)
4284 IEnumerable<TSource> source2 = lastQueryOperator.Child.AsSequentialQuery(querySettings.CancellationState.ExternalCancellationToken);
4285 IEnumerable<TSource> source3 = CancellableEnumerable.Wrap(source2, querySettings.CancellationState.ExternalCancellationToken);
4286 return ExceptionAggregator.WrapEnumerable(source3, querySettings.CancellationState).LastOrDefault(ExceptionAggregator.WrapFunc(predicate, querySettings.CancellationState));
4288 return GetOneWithPossibleDefault(lastQueryOperator, throwIfTwo:
false, defaultIfEmpty:
true);
4300 [global::__DynamicallyInvokable]
4307 return GetOneWithPossibleDefault(
new SingleQueryOperator<TSource>(source,
null), throwIfTwo:
true, defaultIfEmpty:
false);
4320 [global::__DynamicallyInvokable]
4327 if (predicate ==
null)
4331 return GetOneWithPossibleDefault(
new SingleQueryOperator<TSource>(source, predicate), throwIfTwo:
true, defaultIfEmpty:
false);
4342 [global::__DynamicallyInvokable]
4349 return GetOneWithPossibleDefault(
new SingleQueryOperator<TSource>(source,
null), throwIfTwo:
true, defaultIfEmpty:
true);
4363 [global::__DynamicallyInvokable]
4370 if (predicate ==
null)
4374 return GetOneWithPossibleDefault(
new SingleQueryOperator<TSource>(source, predicate), throwIfTwo:
true, defaultIfEmpty:
true);
4385 [global::__DynamicallyInvokable]
4388 return source.DefaultIfEmpty(
default(TSource));
4400 [global::__DynamicallyInvokable]
4407 return new DefaultIfEmptyQueryOperator<TSource>(source, defaultValue);
4421 [global::__DynamicallyInvokable]
4432 ElementAtQueryOperator<TSource> elementAtQueryOperator =
new ElementAtQueryOperator<TSource>(source, index);
4433 if (elementAtQueryOperator.Aggregate(out TSource result, withDefaultValue:
false))
4449 [global::__DynamicallyInvokable]
4458 ElementAtQueryOperator<TSource> elementAtQueryOperator =
new ElementAtQueryOperator<TSource>(source, index);
4459 if (elementAtQueryOperator.Aggregate(out TSource result, withDefaultValue:
true))
4464 return default(TSource);
Provides a set of methods for querying objects that implement ParallelQuery{TSource}....
static TSource Aggregate< TSource >(this ParallelQuery< TSource > source, Func< TSource, TSource, TSource > func)
Applies in parallel an accumulator function over a sequence.
static decimal Sum(this ParallelQuery< decimal > source)
Computes in parallel the sum of a sequence of values.
static TSource Single< TSource >(this ParallelQuery< TSource > source)
Returns the only element of a parallel sequence, and throws an exception if there is not exactly one ...
static TSource FirstOrDefault< TSource >(this ParallelQuery< TSource > source)
Returns the first element of a parallel sequence, or a default value if the sequence contains no elem...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Provides a base class for implementations of the T:System.Collections.Generic.IEqualityComparer`1 gen...
static decimal Average(this ParallelQuery< decimal > source)
Computes in parallel the average of a sequence of values.
static double Average(this ParallelQuery< long > source)
Computes in parallel the average of a sequence of values.
Propagates notification that operations should be canceled.
bool MoveNext()
Advances the enumerator to the next element of the collection.
static IEnumerable< TSource > AsSequential< TSource >(this ParallelQuery< TSource > source)
Converts a T:System.Linq.ParallelQuery`1 into an T:System.Collections.Generic.IEnumerable`1 to force ...
static ? double Sum(this ParallelQuery< double?> source)
Computes in parallel the sum of a sequence of values.
static ParallelQuery< TSource > WithCancellation< TSource >(this ParallelQuery< TSource > source, CancellationToken cancellationToken)
Sets the T:System.Threading.CancellationToken to associate with the query.
static ? int Sum(this ParallelQuery< int?> source)
Computes in parallel the sum of a sequence of values.
static bool Contains< TSource >(this ParallelQuery< TSource > source, TSource value)
Determines in parallel whether a sequence contains a specified element by using the default equality ...
static float Max(this ParallelQuery< float > source)
Returns the maximum value in a parallel sequence of values.
static ParallelQuery< TSource > WithMergeOptions< TSource >(this ParallelQuery< TSource > source, ParallelMergeOptions mergeOptions)
Sets the merge options for this query, which specify how the query will buffer output.
static ParallelQuery< TSource > Where< TSource >(this ParallelQuery< TSource > source, Func< TSource, bool > predicate)
Filters in parallel a sequence of values based on a predicate.
static ? float Average(this ParallelQuery< float?> source)
Computes in parallel the average of a sequence of values.
static Dictionary< TKey, TElement > ToDictionary< TSource, TKey, TElement >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
Creates a T:System.Collections.Generic.Dictionary`2 from a T:System.Linq.ParallelQuery`1 according to...
static ParallelQuery< TSource > AsOrdered< TSource >(this ParallelQuery< TSource > source)
Enables treatment of a data source as if it were ordered, overriding the default of unordered....
static ParallelQuery< TResult > SelectMany< TSource, TResult >(this ParallelQuery< TSource > source, Func< TSource, IEnumerable< TResult >> selector)
Projects in parallel each element of a sequence to an T:System.Collections.Generic....
static int Max(this ParallelQuery< int > source)
Returns the maximum value in a parallel sequence of values.
static TSource Max< TSource >(this ParallelQuery< TSource > source)
Returns the maximum value in a parallel sequence of values.
static decimal Max(this ParallelQuery< decimal > source)
Returns the maximum value in a parallel sequence of values.
static ? int Min(this ParallelQuery< int?> source)
Returns the minimum value in a parallel sequence of values.
static ParallelQuery AsParallel(this IEnumerable source)
Enables parallelization of a query.
static TSource Min< TSource >(this ParallelQuery< TSource > source)
Returns the minimum value in a parallel sequence of values.
static ILookup< TKey, TElement > ToLookup< TSource, TKey, TElement >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
Creates an T:System.Linq.ILookup`2 from a T:System.Linq.ParallelQuery`1 according to specified key se...
static ParallelQuery< TResult > GroupBy< TSource, TKey, TElement, TResult >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, Func< TKey, IEnumerable< TElement >, TResult > resultSelector)
Groups in parallel the elements of a sequence according to a specified key selector function and crea...
Represents an object that handles the low-level work of queuing tasks onto threads.
static ParallelQuery< TResult > Empty< TResult >()
Returns an empty ParallelQuery{TResult} that has the specified type argument.
static TSource First< TSource >(this ParallelQuery< TSource > source)
Returns the first element of a parallel sequence.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
static ParallelQuery< TResult > Cast< TResult >(this ParallelQuery source)
Converts the elements of a ParallelQuery to the specified type.
static ? double Min(this ParallelQuery< double?> source)
Returns the minimum value in a parallel sequence of values.
Represents a callback delegate that has been registered with a T:System.Threading....
static ParallelQuery< TSource > WithExecutionMode< TSource >(this ParallelQuery< TSource > source, ParallelExecutionMode executionMode)
Sets the execution mode of the query.
static ? long Sum(this ParallelQuery< long?> source)
Computes in parallel the sum of a sequence of values.
static TResult Min< TSource, TResult >(this ParallelQuery< TSource > source, Func< TSource, TResult > selector)
Invokes in parallel a transform function on each element of a sequence and returns the minimum value.
static ? decimal Max(this ParallelQuery< decimal?> source)
Returns the maximum value in a parallel sequence of values.
static float Average(this ParallelQuery< float > source)
Computes in parallel the average of a sequence of values.
This is the default setting. PLINQ will examine the query's structure and will only parallelize the q...
static ? decimal Min(this ParallelQuery< decimal?> source)
Returns the minimum value in a parallel sequence of values.
static OrderedParallelQuery< TSource > OrderBy< TSource, TKey >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Sorts in parallel the elements of a sequence in ascending order according to a key.
static ParallelQuery< TResult > SelectMany< TSource, TCollection, TResult >(this ParallelQuery< TSource > source, Func< TSource, IEnumerable< TCollection >> collectionSelector, Func< TSource, TCollection, TResult > resultSelector)
Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1,...
ParallelExecutionMode
The query execution mode is a hint that specifies how the system should handle performance trade-offs...
static double Max(this ParallelQuery< double > source)
Returns the maximum value in a parallel sequence of values.
static ? double Average(this ParallelQuery< int?> source)
Computes in parallel the average of a sequence of values.
static double Min(this ParallelQuery< double > source)
Returns the minimum value in a parallel sequence of values.
static ParallelQuery< TSource > Distinct< TSource >(this ParallelQuery< TSource > source)
Returns distinct elements from a parallel sequence by using the default equality comparer to compare ...
static ParallelQuery< TSource > AsParallel< TSource >(this IEnumerable< TSource > source)
Enables parallelization of a query.
static EqualityComparer< T > Default
Returns a default equality comparer for the type specified by the generic argument.
static ParallelQuery< TResult > Zip< TFirst, TSecond, TResult >(this ParallelQuery< TFirst > first, ParallelQuery< TSecond > second, Func< TFirst, TSecond, TResult > resultSelector)
Merges in parallel two sequences by using the specified predicate function.
static ParallelQuery< TResult > Repeat< TResult >(TResult element, int count)
Generates a parallel sequence that contains one repeated value.
Represents one or more errors that occur during application execution.
static int Sum< TSource >(this ParallelQuery< TSource > source, Func< TSource, int > selector)
Computes in parallel the sum of the sequence of values that are obtained by invoking a transform func...
static ParallelQuery< TSource > Concat< TSource >(this ParallelQuery< TSource > first, ParallelQuery< TSource > second)
Concatenates two parallel sequences.
static TSource SingleOrDefault< TSource >(this ParallelQuery< TSource > source)
Returns the only element of a parallel sequence, or a default value if the sequence is empty; this me...
The exception that is thrown when an operation is performed on a disposed object.
static int Min(this ParallelQuery< int > source)
Returns the minimum value in a parallel sequence of values.
new bool Equals(object x, object y)
Determines whether the specified objects are equal.
static TResult Aggregate< TSource, TAccumulate, TResult >(this ParallelQuery< TSource > source, TAccumulate seed, Func< TAccumulate, TSource, TAccumulate > func, Func< TAccumulate, TResult > resultSelector)
Applies in parallel an accumulator function over a sequence. The specified seed value is used as the ...
static ? decimal Sum(this ParallelQuery< decimal?> source)
Computes in parallel the sum of a sequence of values.
static List< TSource > ToList< TSource >(this ParallelQuery< TSource > source)
Creates a T:System.Collections.Generic.List`1 from an T:System.Linq.ParallelQuery`1.
static ParallelQuery< TSource > Union< TSource >(this ParallelQuery< TSource > first, ParallelQuery< TSource > second)
Produces the set union of two parallel sequences by using the default equality comparer.
static ParallelQuery AsOrdered(this ParallelQuery source)
Enables treatment of a data source as if it were ordered, overriding the default of unordered....
static int Count< TSource >(this ParallelQuery< TSource > source)
Returns the number of elements in a parallel sequence.
static TSource LastOrDefault< TSource >(this ParallelQuery< TSource > source)
Returns the last element of a parallel sequence, or a default value if the sequence contains no eleme...
static OrderedParallelQuery< TSource > ThenBy< TSource, TKey >(this OrderedParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Performs in parallel a subsequent ordering of the elements in a sequence in ascending order according...
static OrderedParallelQuery< TSource > OrderByDescending< TSource, TKey >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Sorts in parallel the elements of a sequence in descending order according to a key.
static double Sum(this ParallelQuery< double > source)
Computes in parallel the sum of a sequence of values.
static ? float Max(this ParallelQuery< float?> source)
Returns the maximum value in a parallel sequence of values.
static double Average(this ParallelQuery< double > source)
Computes in parallel the average of a sequence of values.
static ParallelQuery< TResult > GroupBy< TSource, TKey, TResult >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector, Func< TKey, IEnumerable< TSource >, TResult > resultSelector)
Groups in parallel the elements of a sequence according to a specified key selector function and crea...
object Current
Gets the element in the collection at the current position of the enumerator.
ParallelMergeOptions
Specifies the preferred type of output merge to use in a query. In other words, it indicates how PLIN...
static ? double Average(this ParallelQuery< double?> source)
Computes in parallel the average of a sequence of values.
static ? int Max(this ParallelQuery< int?> source)
Returns the maximum value in a parallel sequence of values.
static OrderedParallelQuery< TSource > ThenByDescending< TSource, TKey >(this OrderedParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Performs in parallel a subsequent ordering of the elements in a sequence in descending order,...
static ParallelQuery< TSource > Take< TSource >(this ParallelQuery< TSource > source, int count)
Returns a specified number of contiguous elements from the start of a parallel sequence.
static TSource [] ToArray< TSource >(this ParallelQuery< TSource > source)
Creates an array from a T:System.Linq.ParallelQuery`1.
static ? long Min(this ParallelQuery< long?> source)
Returns the minimum value in a parallel sequence of values.
Represents a sorted, parallel sequence.
static ? float Sum(this ParallelQuery< float?> source)
Computes in parallel the sum of a sequence of values.
static ? long Max(this ParallelQuery< long?> source)
Returns the maximum value in a parallel sequence of values.
static void ForAll< TSource >(this ParallelQuery< TSource > source, Action< TSource > action)
Invokes in parallel the specified action for each element in the source .
Defines an indexer, size property, and Boolean search method for data structures that map keys to T:S...
static ParallelQuery< int > Range(int start, int count)
Generates a parallel sequence of integral numbers within a specified range.
static long LongCount< TSource >(this ParallelQuery< TSource > source)
Returns an Int64 that represents the total number of elements in a parallel sequence.
static TAccumulate Aggregate< TSource, TAccumulate >(this ParallelQuery< TSource > source, TAccumulate seed, Func< TAccumulate, TSource, TAccumulate > func)
Applies in parallel an accumulator function over a sequence. The specified seed value is used as the ...
static float Min(this ParallelQuery< float > source)
Returns the minimum value in a parallel sequence of values.
Provides a set of static (Shared in Visual Basic) methods for querying objects that implement T:Syste...
static TSource Last< TSource >(this ParallelQuery< TSource > source)
Returns the last element of a parallel sequence.
static bool SequenceEqual< TSource >(this ParallelQuery< TSource > first, ParallelQuery< TSource > second)
Determines whether two parallel sequences are equal by comparing the elements by using the default eq...
static bool All< TSource >(this ParallelQuery< TSource > source, Func< TSource, bool > predicate)
Determines in parallel whether all elements of a sequence satisfy a condition.
Represents a collection of keys and values.To browse the .NET Framework source code for this type,...
static ParallelQuery< TSource > DefaultIfEmpty< TSource >(this ParallelQuery< TSource > source)
Returns the elements of the specified parallel sequence or the type parameter's default value in a si...
static ParallelQuery< TResult > Select< TSource, TResult >(this ParallelQuery< TSource > source, Func< TSource, TResult > selector)
Projects in parallel each element of a sequence into a new form.
The exception that is thrown when one of the arguments provided to a method is not valid.
static long Min(this ParallelQuery< long > source)
Returns the minimum value in a parallel sequence of values.
static ParallelQuery< TSource > Skip< TSource >(this ParallelQuery< TSource > source, int count)
Bypasses a specified number of elements in a parallel sequence and then returns the remaining element...
static decimal Min(this ParallelQuery< decimal > source)
Returns the minimum value in a parallel sequence of values.
static ParallelQuery< IGrouping< TKey, TSource > > GroupBy< TSource, TKey >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Groups in parallel the elements of a sequence according to a specified key selector function.
static ? float Min(this ParallelQuery< float?> source)
Returns the minimum value in a parallel sequence of values.
static int Sum(this ParallelQuery< int > source)
Computes in parallel the sum of a sequence of values.
static ? double Average(this ParallelQuery< long?> source)
Computes in parallel the average of a sequence of values.
static TSource ElementAt< TSource >(this ParallelQuery< TSource > source, int index)
Returns the element at a specified index in a parallel sequence.
static ParallelQuery< TSource > TakeWhile< TSource >(this ParallelQuery< TSource > source, Func< TSource, bool > predicate)
Returns elements from a parallel sequence as long as a specified condition is true.
static ParallelQuery< TResult > GroupJoin< TOuter, TInner, TKey, TResult >(this ParallelQuery< TOuter > outer, ParallelQuery< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, IEnumerable< TInner >, TResult > resultSelector)
Correlates in parallel the elements of two sequences based on equality of keys and groups the results...
static long Sum(this ParallelQuery< long > source)
Computes in parallel the sum of a sequence of values.
static ParallelQuery< TSource > SkipWhile< TSource >(this ParallelQuery< TSource > source, Func< TSource, bool > predicate)
Bypasses elements in a parallel sequence as long as a specified condition is true and then returns th...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
static ParallelQuery< TSource > WithDegreeOfParallelism< TSource >(this ParallelQuery< TSource > source, int degreeOfParallelism)
Sets the degree of parallelism to use in a query. Degree of parallelism is the maximum number of conc...
static Dictionary< TKey, TSource > ToDictionary< TSource, TKey >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Creates a T:System.Collections.Generic.Dictionary`2 from a T:System.Linq.ParallelQuery`1 according to...
Signals to a T:System.Threading.CancellationToken that it should be canceled.
static ParallelQuery< TSource > Intersect< TSource >(this ParallelQuery< TSource > first, ParallelQuery< TSource > second)
Produces the set intersection of two parallel sequences by using the default equality comparer to com...
static ParallelQuery< TSource > Except< TSource >(this ParallelQuery< TSource > first, ParallelQuery< TSource > second)
Produces the set difference of two parallel sequences by using the default equality comparer to compa...
The exception that is thrown when a method call is invalid for the object's current state.
static float Sum(this ParallelQuery< float > source)
Computes in parallel the sum of a sequence of values.
static double Average(this ParallelQuery< int > source)
Computes in parallel the average of a sequence of values.
static ILookup< TKey, TSource > ToLookup< TSource, TKey >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector)
Creates an T:System.Linq.ILookup`2 from a T:System.Linq.ParallelQuery`1 according to a specified key ...
static TSource ElementAtOrDefault< TSource >(this ParallelQuery< TSource > source, int index)
Returns the element at a specified index in a parallel sequence or a default value if the index is ou...
static ? decimal Average(this ParallelQuery< decimal?> source)
Computes in parallel the average of a sequence of values.
static long Max(this ParallelQuery< long > source)
Returns the maximum value in a parallel sequence of values.
static ? double Max(this ParallelQuery< double?> source)
Returns the maximum value in a parallel sequence of values.
The exception that is thrown when an invoked method is not supported, or when there is an attempt to ...
static ParallelQuery< TSource > Reverse< TSource >(this ParallelQuery< TSource > source)
Inverts the order of the elements in a parallel sequence.
Defines size, enumerators, and synchronization methods for all nongeneric collections.
The exception that is thrown when a call is made to the M:System.Threading.Thread....
static double Average< TSource >(this ParallelQuery< TSource > source, Func< TSource, int > selector)
Computes in parallel the average of a sequence of values that are obtained by invoking a transform fu...
static bool Any< TSource >(this ParallelQuery< TSource > source, Func< TSource, bool > predicate)
Determines in parallel whether any element of a sequence satisfies a condition.
static ParallelQuery< TSource > AsUnordered< TSource >(this ParallelQuery< TSource > source)
Allows an intermediate query to be treated as if no ordering is implied among the elements.
static TResult Max< TSource, TResult >(this ParallelQuery< TSource > source, Func< TSource, TResult > selector)
Invokes in parallel a transform function on each element of a sequence and returns the maximum value.
Represents a particular manner of splitting a data source into multiple partitions.
static ParallelQuery< TResult > OfType< TResult >(this ParallelQuery source)
Filters the elements of a ParallelQuery based on a specified type.
CancellationTokenRegistration Register(Action callback)
Registers a delegate that will be called when this T:System.Threading.CancellationToken is canceled.
void Dispose()
Releases all resources used by the current instance of the T:System.Threading.CancellationTokenRegist...
static IEnumerable< TSource > AsEnumerable< TSource >(this ParallelQuery< TSource > source)
Converts a T:System.Linq.ParallelQuery`1 into an T:System.Collections.Generic.IEnumerable`1 to force ...
static ParallelQuery< IGrouping< TKey, TElement > > GroupBy< TSource, TKey, TElement >(this ParallelQuery< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
Groups in parallel the elements of a sequence according to a specified key selector function and proj...
static ParallelQuery< TResult > Join< TOuter, TInner, TKey, TResult >(this ParallelQuery< TOuter > outer, ParallelQuery< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, TInner, TResult > resultSelector)
Correlates in parallel the elements of two sequences based on matching keys. The default equality com...