summaryrefslogtreecommitdiff
path: root/ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/examples/reading/get-dynamic-records/index.md
blob: d9f1cb7416b850192066e6d1ad2cc16ede95dfaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Get Dynamic Records

Convert CSV rows into `dynamic` objects. Since there is no way to tell what type the properties should be, all the properties on the dynamic object are strings.

###### Data

```
Id,Name
1,one
```

###### Example

```cs
void Main()
{
    using (var reader = new StreamReader("path\\to\\file.csv"))
    using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
    {
        var records = csv.GetRecords<dynamic>();
    }
}
```