@@ -22,20 +22,30 @@ public class Row : QuackingDictionary, IEquatable<Row>
22
22
static readonly Dictionary < Type , List < PropertyInfo > > propertiesCache = new Dictionary < Type , List < PropertyInfo > > ( ) ;
23
23
static readonly Dictionary < Type , List < FieldInfo > > fieldsCache = new Dictionary < Type , List < FieldInfo > > ( ) ;
24
24
25
+ /// <summary>
26
+ /// Initializes a new instance of the <see cref="Row"/> class.
27
+ /// </summary>
28
+ /// <param name="comparer">Defines key equality</param>
29
+ public Row ( StringComparer comparer )
30
+ : base ( new Hashtable ( ) , comparer )
31
+ {
32
+ }
33
+
25
34
/// <summary>
26
35
/// Initializes a new instance of the <see cref="Row"/> class.
27
36
/// </summary>
28
37
public Row ( )
29
- : base ( new Hashtable ( StringComparer . InvariantCultureIgnoreCase ) )
38
+ : base ( new Hashtable ( ) )
30
39
{
31
40
}
32
41
33
42
/// <summary>
34
43
/// Initializes a new instance of the <see cref="Row"/> class.
35
44
/// </summary>
36
45
/// <param name="itemsToClone">The items to clone.</param>
37
- protected Row ( IDictionary itemsToClone )
38
- : base ( new Hashtable ( itemsToClone , StringComparer . InvariantCultureIgnoreCase ) )
46
+ /// <param name="comparer">Defines key equality</param>
47
+ protected Row ( IDictionary itemsToClone , StringComparer comparer )
48
+ : base ( itemsToClone , comparer )
39
49
{
40
50
}
41
51
@@ -46,7 +56,7 @@ protected Row(IDictionary itemsToClone)
46
56
/// <param name="source">The source row.</param>
47
57
public void Copy ( IDictionary source )
48
58
{
49
- items = new Hashtable ( source , StringComparer . InvariantCultureIgnoreCase ) ;
59
+ items = new Hashtable ( source , Comparer ) ;
50
60
}
51
61
52
62
/// <summary>
@@ -72,7 +82,7 @@ public IEnumerable<string> Columns
72
82
/// <returns></returns>
73
83
public Row Clone ( )
74
84
{
75
- Row row = new Row ( this ) ;
85
+ Row row = new Row ( this , Comparer ) ;
76
86
return row ;
77
87
}
78
88
@@ -85,7 +95,10 @@ public Row Clone()
85
95
/// <param name="other">An object to compare with this object.</param>
86
96
public bool Equals ( Row other )
87
97
{
88
- if ( Columns . SequenceEqual ( other . Columns , StringComparer . InvariantCultureIgnoreCase ) == false )
98
+ if ( ! Comparer . Equals ( other . Comparer ) )
99
+ return false ;
100
+
101
+ if ( Columns . SequenceEqual ( other . Columns , Comparer ) == false )
89
102
return false ;
90
103
91
104
foreach ( var key in items . Keys )
0 commit comments