locked
Where to call .AsParallel() in a LINQ query RRS feed

  • Question

  • User527076549 posted
     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 ??

    Thursday, September 19, 2019 8:27 AM

Answers