Parelle.Foreach not updating the list in C#
I have below code which will call couple of services and finally add the items to collection. But the problem is it’s not updating my list though I am using thread safe collection ConcurrentBag class. I am using Parellel.ForEach for fast performance for processing each request id. My code is compiling with no error, and I can see the values list while debugging but at the end of request getting null in response. Also sometimes, the code is getting executed twice when I do debugging. I am not sure is it because of Parellel.ForEach loop.