I'm implementing a "reconciliation" library which will allow to perform diffs between different data objects. As part of the implementation, I'm converting the objects to compare (mostly CSV files) to datatables and doing a specific steps of comparison with the last one being comparing the actual values from the rows.
For doing the row comparison I'm using the code below:
var rowsMissingInTrgt = rowsInTrgt.Except(rowsInSrc, DataRowComparer.Default);
var rowsMissingInSrc = rowsInSrc.Except(rowsInTrgt, DataRowComparer.Default);
return rowsMissingInSrc.Count() > 0 ? false :
rowsMissingInTrgt.Count() > 0 ? false :
true;
Instead of using the default DataRowComparer, I would like to implement a custom DataRowComparer, but would like all the comparison to happen in parallel as those tasks are independent of each other and at the end provide optionality to do either a logical_AND or logical_OR on the comparison tasks.
Questions:
Is implementing the "
IEqualityComparer<TRow>where TRow : DataRow
" sufficient to invoke a parallel comparison of the rows?For the logical_AND, I think, it would make sense to abort the rest of the comparisons on the first "false". Can this be done?
For the logical_OR, I would need something similar to wait_All on the threads. How can this be implemented?