public static string ToCsv<TSource>(
IEnumerable<TSource> data,
CsvFrom<TSource> converter,
char delimiter = ',',
IReadOnlyCollection<string?>? columnNames = null
)
Public Shared Function ToCsv(Of TSource) (
data As IEnumerable(Of TSource),
converter As CsvFrom(Of TSource),
Optional delimiter As Char = ","C,
Optional columnNames As IReadOnlyCollection(Of String) = Nothing
) As String
public:
generic<typename TSource>
static String^ ToCsv(
IEnumerable<TSource>^ data,
CsvFrom<TSource>^ converter,
wchar_t delimiter = L',',
IReadOnlyCollection<String^>^ columnNames = nullptr
)
static member ToCsv :
data : IEnumerable<'TSource> *
converter : CsvFrom<'TSource> *
?delimiter : char *
?columnNames : IReadOnlyCollection<string>
(* Defaults:
let _delimiter = defaultArg delimiter ','
let _columnNames = defaultArg columnNames null
*)
-> string
A collection of column names for the header to be written, or null to use the PropertyNames of the CsvMapping as column names.
The collection determines the order in which the columns appear in the CSV file.
The collection will be copied. If the collection contains null values, empty strings, or white space, these are replaced by automatically generated column names. Column names cannot appear twice. By default the comparison is case-sensitive but it will be reset to a case-insensitive comparison if the column names are also unique when treated case-insensitive.
ArgumentNullException | data or converter is null. |
ArgumentException | A column name in columnNames occurs twice. |
IOException | I/O error. |