summaryrefslogtreecommitdiff
path: root/ThirdParty/CsvHelper-master/src/CsvHelper.Website/input/migration/v22/index.md
blob: ea7972f1baafc20c22a8fbd3f6af89a95ef1a203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Migrating from version 21 to 22

## ParserMode

Name change to `CsvMode`.

```cs
// v21
ParserMode.RFC4180

//v22
CsvMode.RFC4180
```

## ShouldQuote

```cs
// v21
var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
	ShouldQuote = (field, context) => true,
};

// v22
var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
	ShouldQuote = (field, context, row) => true,
};
```

## EnumConverter

`EnumConverter` was changed to case sensitive by default.

If you want Enums to ignore case, you need to set a type converter option.

```cs
Map(m => m.Property).TypeConverterOption.EnumIgnoreCase();
```

## IParserConfiguration

- Added `ProcessFieldBufferSizse`.

Any class that implements `IParserConfiguration` will need these changes applied to it.

## IWriterConfiguration

- Added `Mode`.

Any class that implements `IWriterConfiguration` will need these changes applied to it.