public static CsvReader<TResult> OpenRead<TResult>(
TextReader reader,
CsvMapping mapping,
Func<Object, TResult> conversion,
char delimiter = ',',
bool isHeaderPresent = true,
CsvOpts options = CsvOpts.Default
)
Public Shared Function OpenRead(Of TResult) (
reader As TextReader,
mapping As CsvMapping,
conversion As Func(Of Object, TResult),
Optional delimiter As Char = ","C,
Optional isHeaderPresent As Boolean = true,
Optional options As CsvOpts = CsvOpts.Default
) As CsvReader(Of TResult)
public:
generic<typename TResult>
static CsvReader<TResult>^ OpenRead(
TextReader^ reader,
CsvMapping^ mapping,
Func<Object^, TResult>^ conversion,
wchar_t delimiter = L',',
bool isHeaderPresent = true,
CsvOpts options = CsvOpts::Default
)
static member OpenRead :
reader : TextReader *
mapping : CsvMapping *
conversion : Func<Object, 'TResult> *
?delimiter : char *
?isHeaderPresent : bool *
?options : CsvOpts
(* Defaults:
let _delimiter = defaultArg delimiter ','
let _isHeaderPresent = defaultArg isHeaderPresent true
let _options = defaultArg options CsvOpts.Default
*)
-> CsvReader<'TResult>
A function that converts the content of mapping to an instance of TResult.
The function is called for each row in the CSV data and gets the CsvMapping as argument, filled with the current CsvRecord instance. The CsvMapping is passed to the function as dynamic argument: Inside the function the registered DynamicProperty instances can be used like regular .NET properties, but without IntelliSense ("late binding").
ArgumentNullException | reader, or mapping, or conversion is null. |
ArgumentOutOfRangeException | delimiter is either the double quotes " or a line break character ('\r' or '\n'). |