var number = Enumerable.Range(1, 10);
var result = number.AsParallel().Where(i => i % 2 == 0).ToArray();
OR
number.Where(i=>i%2==0).Select(i=>i).AsParallel().ToArray()
what is the difference between these two statements ,can anyone explain this ??
Amitha
All the Best . Please 'Mark this Post as Answer ' if it helps you.
Member
55 Points
167 Posts
Where to call .AsParallel() in a LINQ query
Sep 19, 2019 08:27 AM|amithashenoy|LINK
what is the difference between these two statements ,can anyone explain this ??
All the Best . Please 'Mark this Post as Answer ' if it helps you.
All-Star
40405 Points
6196 Posts
Microsoft
Re: Where to call .AsParallel() in a LINQ query
Sep 20, 2019 02:44 AM|Fei Han - MSFT|LINK
Hi Amitha,
In [this document](https://docs.microsoft.com/en-us/dotnet/standard/parallel-programming/introduction-to-plinq?view=netframework-4.8#the-parallelenumerable-class), you can find it would specify the rest of the query should be parallelized.
With Regards,
Fei Han
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue.