Defines a custom IComparer<T> to be used for comparing keys
Syntax
Example
BPlusTree/BPlusTree.Test/TestBulkInsert.cs
C# | Copy Code |
---|
Dictionary<int, string> test = new Dictionary<int, string>();
List<IEnumerable<KeyValuePair<int, string>>> sets =
new List<IEnumerable<KeyValuePair<int, string>>>(CreateSets(2, 100, test));
foreach (KeyValuePair<int, string> pair in
OrderedKeyValuePairs<int, string>.Merge(Options.KeyComparer, DuplicateHandling.LastValueWins, sets.ToArray()))
{
string val;
Assert.IsTrue(test.TryGetValue(pair.Key, out val));
Assert.AreEqual(pair.Value, val);
Assert.IsTrue(test.Remove(pair.Key));
}
Assert.AreEqual(0, test.Count); |
VB.NET | Copy Code |
---|
Dim test As New Dictionary(Of Integer, String)()
Dim sets As New List(Of IEnumerable(Of KeyValuePair(Of Integer, String)))(CreateSets(2, 100, test))
For Each pair As KeyValuePair(Of Integer, String) In OrderedKeyValuePairs(Of Integer, String).Merge(Options.KeyComparer, DuplicateHandling.LastValueWins, sets.ToArray())
Dim val As String
Assert.IsTrue(test.TryGetValue(pair.Key, val))
Assert.AreEqual(pair.Value, val)
Assert.IsTrue(test.Remove(pair.Key))
Next
Assert.AreEqual(0, test.Count) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also