Table of Contents

Class SheetRowAttribute

Namespace
SheetStream
Assembly
SheetStream.dll

Marks a partial class or struct whose column mapping is generated at compile time by the SheetStream source generator (shipped inside the SheetStream package). The generator adds a static SheetMapper property implementing ISheetRowMapper<T> and, on .NET 5 and later, registers it automatically so LoadFromCollection and ExcelReader.Read<T> need no reflection: the type then works when trimmed or published with Native AOT.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
public sealed class SheetRowAttribute : Attribute
Inheritance
SheetRowAttribute
Inherited Members

Examples

[SheetRow]
public partial class Order
{
    [SheetColumn("Order #", Order = 0)] public int Id { get; set; }
    [SheetColumn(NumberFormat = "#,##0.00")] public decimal Amount { get; set; }
}