@@ -33,7 +33,7 @@ public static void WriteObjectRow(TextWriter writer, IEnumerable<object> row)
3333 writer . Write ( CsvConfig . RowSeparatorString ) ;
3434 }
3535
36- public static void Write ( TextWriter writer , IEnumerable < Dictionary < string , object > > records )
36+ public static void Write ( TextWriter writer , IEnumerable < IDictionary < string , object > > records )
3737 {
3838 if ( records == null ) return ; //AOT
3939
@@ -49,7 +49,7 @@ public static void Write(TextWriter writer, IEnumerable<Dictionary<string, objec
4949 }
5050 }
5151
52- public static void Write ( TextWriter writer , IEnumerable < Dictionary < string , string > > records )
52+ public static void Write ( TextWriter writer , IEnumerable < IDictionary < string , string > > records )
5353 {
5454 if ( records == null ) return ; //AOT
5555
@@ -221,9 +221,15 @@ public static void Write(TextWriter writer, IEnumerable<T> records)
221221 {
222222 if ( writer == null ) return ; //AOT
223223
224- if ( typeof ( T ) == typeof ( Dictionary < string , string > ) )
224+ if ( typeof ( T ) == typeof ( Dictionary < string , string > ) || typeof ( T ) == typeof ( IDictionary < string , string > ) )
225225 {
226- CsvDictionaryWriter . Write ( writer , ( IEnumerable < Dictionary < string , string > > ) records ) ;
226+ CsvDictionaryWriter . Write ( writer , ( IEnumerable < IDictionary < string , string > > ) records ) ;
227+ return ;
228+ }
229+
230+ if ( typeof ( T ) == typeof ( Dictionary < string , object > ) || typeof ( T ) == typeof ( IDictionary < string , object > ) )
231+ {
232+ CsvDictionaryWriter . Write ( writer , ( IEnumerable < IDictionary < string , object > > ) records ) ;
227233 return ;
228234 }
229235
0 commit comments