Path: redb-route/redb.Route.DataFormats.Csv/README.md Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.DataFormats.Csv/README.md ---- # redb.Route.DataFormats.Csv > Documentation and articles: CSV as a redb.Route data format, on [CsvHelper](https://joshclose.github.io/CsvHelper/). ```csharp // per-node options .UnmarshalCsv>(o => { o.Delimiter = ";"; o.HasHeaderRecord = true; }) .MarshalCsv() // or by content type, after registering once context.AddCsvDataFormat(); // builder.AddCsvDataFormat() with DI .Marshal("text/csv") .Unmarshal>("text/csv") .Unmarshal>() // driven by the message ContentType (text/csv) ``` | Direction | Body in | Body out | |---|---|---| | Marshal | `IEnumerable` of POCOs (header from property names), `IEnumerable` (header from keys), `IEnumerable` / `object[]` rows (no header), a single POCO, a ready CSV `string` | `byte[]`, `ContentType = text/csv` | | Unmarshal | `byte[]`, `string`, `Stream` | `List` / `T[]` / `IEnumerable` of POCOs; `List>` (with header) or `List` (without); a single `T`; `string` | Options: `Delimiter` (`,`), `HasHeaderRecord` (`true`), `Quote` (`"`), `Culture` (invariant), `TrimFields`, `NewLine` (`\r\n`), `Encoding` (UTF-8 without BOM). Quotes, embedded newlines and empty fields follow RFC 4180. XML form: ``, ``.