If there any alternative for parallel foreach issue

Settu Ranganathan 1 Reputation point
2023-03-10T08:20:52.8466667+00:00
    1. We are using the parallel foreach for Asyn process, and it sometimes returns an unexpected value, how can I resolve this functionality issue
  1. Or is there any alternative solution for parallel foreach
Developer technologies ASP.NET Other
Developer technologies C#
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2023-03-10T09:32:18.0733333+00:00

    If you are using the .NET 6 or higher, then consider await Parallel.ForEachAsync(...).

    Otherwise, show details to reproduce the problem.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.