Today i tried do some optimization to foreach statement, that works on XDocument.
foreach
XDocument
Before optimization:
foreach (XElement el
use it like this:
int ParallelThreads = 10; Parallel.ForEach(xDoc.Descendants("APSEvent").ToList(), new ParallelOptions() { MaxDegreeOfParallelism = ParallelThreads }, (myXDOC, i, j) => { //do whatever you want here });