Parallel Foreach Race Condition
问题 i have an issue with a parallel foreach closing the connection before it finishes executing. when i had a regular foreach loop runnung it was slow but it would return everything. once i changed to a parallel foreach it is now returning about 95% of the data and terminating. below is the code that i am using: var USPostalCodes = repository.GetUSPostalCodes(); var CAPostalCodes = repository.GetCAPostalCodes(); Parallel.ForEach(spreadsheetinfo, location => { LocationData Locationdata = new