Table of Contents

Class ExcelRecordMapBuilder<T, TRow>

Namespace
ExcelReader.Core.Writer
Assembly
ExcelReader.Core.dll

Accumulates a property-to-column write plan for T, fed either by the source generator (feature A) or by a hand-written IExcelRecordMap<T> implementation. The write-side counterpart to ExcelRowMapBuilder<T>.

public sealed class ExcelRecordMapBuilder<T, TRow> where T : allows ref struct where TRow : IRowWriter

Type Parameters

T

The record type being mapped.

TRow

The concrete row writer the columns write through. A type parameter rather than IRowWriter so each column action compiles against that sealed class and its cell writes resolve to it directly instead of dispatching through the interface once per cell — the same trade RecordColumns{T}.Plan{TRow} makes on the reflection side. The cost is one plan per (T, TRow) pair instead of one per T: a record written to three formats configures its map three times.

Inheritance
ExcelRecordMapBuilder<T, TRow>
Inherited Members

Methods

Column(string, Action<TRow, T>)

Adds a column: its header text, and how to write one record's value for it.

public ExcelRecordMapBuilder<T, TRow> Column(string header, Action<TRow, T> write)

Parameters

header string

The column's header text.

write Action<TRow, T>

Writes exactly one cell for header's column, from a record.

Returns

ExcelRecordMapBuilder<T, TRow>

This builder, for chaining.