예제 #1
0
 public ReadResult(TKey id, Sort sort, List <ReadResult <TKey, TEntry> > resultsToCompose)
 {
     Key     = id;
     Sort    = sort;
     Entries = MergeSort.Sort(
         collections: resultsToCompose.Select(x => x.Entries),
         comparer: EntryComparer.GetComparer <TKey, TEntry>(Sort),
         resolveConflict: x => x.First());
 }
예제 #2
0
        public ReadResult <TKey, TEntry> MergeWith(ReadResult <TKey, TEntry> other)
        {
            Entries = MergeSort.Sort(
                collections: new[] { Entries, other.Entries },
                comparer: EntryComparer.GetComparer <TKey, TEntry>(Sort),
                resolveConflict: x => x.First());

            return(this);
        }