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()); }
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); }