title: Parallel.Foreach for calling and consuming multiple function
body: <p>I want to do a Parallel.ForEach(... ) for the below code snipet, however as there are two function calls - both should happend in the same block, as the second funtion is consuming the value returned by the first function. I don't know who to achive this. Basically I want to convert the below into a Parallel.ForEach(...). Thanks in advance.</p>
  
  <pre><code>       List&lt;Employee&gt; employeeList = GetEmployees();
  
         foreach (var emp in employeeList)
              {
                  var empDetails = GetEmpDetails(emp.EmployeeId);
  
                  ProcessEmployeeDetails(empDetails);
              }
  </code></pre>
  
  <p>I already tried the below, it is not working:</p>
  
  <pre><code>            Parallel.ForEach(employeeList, emp =&gt;
              {
                  var empDetails = GetEmpDetails(emp.EmployeeId);
  
                  ProcessEmployeeDetails(empDetails);
  
              });
  </code></pre>