Skip to content

v1.15.0

Compare
Choose a tag to compare
@sveinungf sveinungf released this 12 May 20:57
· 382 commits to main since this release

Features

  • Support for inheritance when using the source generator. By default, the source generator will only create columns from properties defined directly on the type passed to the WorksheetRow attribute. With the new InheritColumns attribute, the base class will be taken into account as well. Here is an example:

    public class Vehicle
    {
        public int Wheels { get; set; }
        public bool HasEngine { get; set; }
    }
    
    [InheritColumns]
    public class Car : Vehicle
    {
        public string Make { get; set; }
        public string Model { get; set; }
    }
    
    [WorksheetRow(typeof(Car))]
    public partial class CarContext : WorksheetRowContext;

    In this example, the columns will be created in this order: Wheels, HasEngine, Make, Model. The order can be customized by setting DefaultColumnOrder on the InheritColumns attribute, or by using the ColumnOrder attribute directly on the properties. Thanks to @Ashymonth for the contribution!

  • String cells can now be created from ReadOnlyMemory<char> in addition to string. New constructors have been added to Cell, StyledCell, and DataCell.

Performance improvements

  • Most of the DataCell constructors are now branchless on .NET 8 and later.
  • Improved performance of creating workbook.xml (metadata file that is part of an XLSX file).