This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.CsvHelper.
Summary
Reads a CSV file into a C# object.
Syntax
public static IEnumerable<T> ReadCsv<T>(this ICakeContext context, FilePath csvFile, ClassMap classMap, CsvHelperSettings settings)
Examples
var people = ReadCsv<Person>("./people.csv", new ClassMap(), new CsvHelperSettings { HasHeaderRecord = true });
Attributes
| Type |
Description |
| CakeMethodAliasAttribute |
|
| CakeAliasCategoryAttribute |
|
| CakeNamespaceImportAttribute |
|
Type Parameters
| Name |
Description |
| T |
The type. |
Parameters
| Name |
Type |
Description |
| context |
ICakeContext |
The context. |
| csvFile |
FilePath |
The CSV to read. |
| classMap |
ClassMap |
The CSV class map. |
| settings |
CsvHelperSettings |
The settings. |
Return Value
| Type |
Description |
| IEnumerable<T> |
List objects as defined by type. |