Skip to content

CSV Helper

The AxisEndpoints.Extensions.CsvHelper package adds typed CSV import and export to AxisEndpoints endpoints, backed by CsvHelper.

Terminal window
dotnet add package AxisEndpoints.Extensions.CsvHelper

Register the extension services in Program.cs:

using AxisEndpoints.Extensions;
using AxisEndpoints.Extensions.CsvHelper;
builder.Services.AddAxisEndpoints();
builder.Services.AddAxisEndpointsCsvHelper(); // registers CsvBindingExceptionFilter
  • CSV Import — parse incoming CSV data into typed rows
  • CSV Export — stream typed rows as a CSV download
  • Row Validation — validate each row with DataAnnotations
  • Class Map — customize column-to-property mapping