Class ProtoSheetModel<TRow>
A sheet modelled as a record: [Sheet] and [Column] declare the layout once, the model
verifies it, and tests read typed rows and columns without repeating header paths. The record is the
model; ProtoSheetModel<TRow> remains the escape hatch for shapes a record cannot hold.
public sealed class ProtoSheetModel<TRow> where TRow : notnull
Type Parameters
TRow
- Inheritance
-
ProtoSheetModel<TRow>
- Inherited Members
- Extension Methods
Properties
Rows
The data rows, projected onto the record.
public IReadOnlyList<TRow> Rows { get; }
Property Value
- IReadOnlyList<TRow>
Sheet
public ProtoSheet Sheet { get; }
Property Value
Methods
Column<TValue>(Expression<Func<TRow, TValue>>)
Reads a whole column as typed values with property-style assertions.
public ProtoModelColumn<TValue> Column<TValue>(Expression<Func<TRow, TValue>> property)
Parameters
propertyExpression<Func<TRow, TValue>>
Returns
- ProtoModelColumn<TValue>
Type Parameters
TValue
Row(Func<TRow, bool>)
Finds the first row matching the predicate; no match fails the test.
public TRow Row(Func<TRow, bool> predicate)
Parameters
Returns
- TRow
Verify()
Checks every declared column against the record's shape; all violations are reported.
public void Verify()