コード例 #1
0
ファイル: RecordReconciler.cs プロジェクト: mvbalaw/EtlGate
        public ReconciliationStatus ReconcileRecords(Record left, Record right, IRecordKeyComparer recordKeyComparer)
        {
            var fieldComparisonResult = recordKeyComparer.Compare(left, right);
            if (fieldComparisonResult == 0)
            {
                return DictionaryAllEntriesMatch(left, right) ? ReconciliationStatus.Same : ReconciliationStatus.Updated;
            }

            return fieldComparisonResult < 0 ? ReconciliationStatus.Deleted : ReconciliationStatus.Added;
        }
コード例 #2
0
        public IEnumerable<ReconciliationResult<Record>> Reconcile(IEnumerable<Record> left, IEnumerable<Record> right, IRecordReconciler recordReconciler, IRecordKeyComparer recordKeyComparer)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left");
            }
            if (right == null)
            {
                throw new ArgumentNullException("right");
            }
            if (recordKeyComparer == null)
            {
                throw new ArgumentNullException("recordKeyComparer");
            }

            var comparer = new OrderedReconciler<Record>();
            return comparer
                .Reconcile(left, right, (o, n) => recordReconciler.ReconcileRecords(o, n, recordKeyComparer))
                .Where(result => result.Status != ReconciliationStatus.Same);
        }
コード例 #3
0
ファイル: RecordExtensions.cs プロジェクト: mvbalaw/EtlGate
 public static IEnumerable<Record> Sort(this IEnumerable<Record> input, IRecordKeyComparer comparer)
 {
     return input.OrderBy(x => x, comparer);
 }