public static string ToCsv<TSource>(
IEnumerable<TSource> data,
int columnsCount,
CsvMapping mapping,
Action<TSource, Object> conversion,
char delimiter = ','
)
Public Shared Function ToCsv(Of TSource) (
data As IEnumerable(Of TSource),
columnsCount As Integer,
mapping As CsvMapping,
conversion As Action(Of TSource, Object),
Optional delimiter As Char = ","C
) As String
public:
generic<typename TSource>
static String^ ToCsv(
IEnumerable<TSource>^ data,
int columnsCount,
CsvMapping^ mapping,
Action<TSource, Object^>^ conversion,
wchar_t delimiter = L','
)
static member ToCsv :
data : IEnumerable<'TSource> *
columnsCount : int *
mapping : CsvMapping *
conversion : Action<'TSource, Object> *
?delimiter : char
(* Defaults:
let _delimiter = defaultArg delimiter ','
*)
-> string
A method that fills the content of a TSource instance into the properties of mapping.
conversion is called with each CSV row to be written and it gets the TSource instance and mapping as arguments. mapping is passed to the method as dynamic argument: Inside the conversion method the registered DynamicProperty instances can be used like regular .NET properties, but without IntelliSense ("late binding").
With each call of conversion all DynamicProperty instances in mapping are reset to their DefaultValue.
ArgumentNullException | data, or mapping, or conversion is null. |
ArgumentOutOfRangeException | columnsCount is negative. |
IOException | I/O error. |