feat(ExcelIO): add ColumnDefinition for fluent mapping

This commit is contained in:
Joseph Doherty
2026-01-06 23:21:28 -05:00
parent 90e47c27c6
commit bfbec425f4
2 changed files with 34 additions and 0 deletions
@@ -0,0 +1,34 @@
namespace JdeScoping.ExcelIO.Mapping;
/// <summary>
/// Defines how a property maps to an Excel column.
/// </summary>
public sealed class ColumnDefinition
{
/// <summary>Property name for debugging/error messages.</summary>
public required string PropertyName { get; init; }
/// <summary>Compiled delegate to get property value from object.</summary>
public required Func<object, object?> ValueGetter { get; init; }
/// <summary>Property type for formatting decisions.</summary>
public required Type PropertyType { get; init; }
/// <summary>Column display order (lower = leftmost).</summary>
public int Order { get; set; }
/// <summary>Column header text.</summary>
public string HeaderText { get; set; } = string.Empty;
/// <summary>Excel number format string.</summary>
public string Format { get; set; } = "@";
/// <summary>Auto-size column width.</summary>
public bool AutoWidth { get; set; } = true;
/// <summary>Manual column width (when AutoWidth = false).</summary>
public double Width { get; set; }
/// <summary>Enable text wrapping.</summary>
public bool WrapText { get; set; }
}