Repository navigation
Write to CSV: move to CsvHelper 34 and net11.0 - #2456
Merged
vladimir-pecanac-main merged 1 commit intoDec 1, 2026
Merged
vladimir-pecanac-main merged 1 commit into
vladimir-pecanac-main merged 1 commit into
Conversation
CsvHelper 34 replaced the writer API, so the sample stopped compiling
against the current package.
- CsvWriter.ToFile and CsvWriter.Create with CsvWriterOptions replace
new CsvWriter(writer, culture) and CsvConfiguration
- Person, Contact and Employee are [CsvRecord] partial classes;
[CsvColumn], [CsvFormat], [CsvCulture], [CsvBooleanValues],
[CsvConstant], [CsvNullValues] and [CsvIgnore] replace the old
attributes, and [CsvOptions] with CsvWriterOptions.For<T>() replaces
the class-level Delimiter and HasHeaderRecord
- PersonMap is a [CsvRecordMap] class over a class we cannot annotate
- Employee's salary uses [CsvCulture("de-DE")]: [CsvFormat] now applies
to dates and times only
- New tests: the culture no longer changes the separator, and
CsvInjection.Escape guards formulas
- net10.0 to net11.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CsvHelper 34 replaced the writer API, so the sample no longer compiled against the current package. The sample, its record map and its tests now use CsvWriter.ToFile, CsvWriter.Create, CsvWriterOptions and the Csv* attributes, and the projects target net11.0. Local run: 11 of 11 tests pass.