From 84e7f62cecec1c70358eb391cf60228de70ecfc4 Mon Sep 17 00:00:00 2001 From: Michele Bastione Date: Sat, 21 Nov 2026 00:41:48 +0100 Subject: [PATCH 1/5] Removed obsolete facade overloads The following methods have been removed: - The overloads `MappingTemplater.ApplyTemplate` for methods `MappingTemplater.FillTemplate` - The overloads `OpenXmlEporter.AlterSheet for methods `OpenXmlEditor.AlterSheetInfo` --- .../Api/MappingTemplater.cs | 34 ------------------- src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs | 32 ----------------- 2 files changed, 66 deletions(-) diff --git a/src/MiniExcel.OpenXml.FluentMapping/Api/MappingTemplater.cs b/src/MiniExcel.OpenXml.FluentMapping/Api/MappingTemplater.cs index 417e78bf..b1cf6518 100644 --- a/src/MiniExcel.OpenXml.FluentMapping/Api/MappingTemplater.cs +++ b/src/MiniExcel.OpenXml.FluentMapping/Api/MappingTemplater.cs @@ -75,38 +75,4 @@ public async Task FillTemplateAsync( await FillTemplateAsync(outputStream, templateStream, values, cancellationToken).ConfigureAwait(false); } - -#region Obsolete -[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")] -public Task ApplyTemplateAsync( - string? outputPath, - string? templatePath, - IEnumerable? values, - CancellationToken cancellationToken = default) where T : class -{ - return FillTemplateAsync(outputPath, templatePath, values, cancellationToken); -} - -[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")] -public Task ApplyTemplateAsync( - Stream? outputStream, - Stream? templateStream, - IEnumerable? values, - CancellationToken cancellationToken = default) where T : class -{ - return FillTemplateAsync(outputStream, templateStream, values, cancellationToken); } - - -[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")] -public Task ApplyTemplateAsync( - Stream? outputStream, - byte[]? templateBytes, - IEnumerable? values, - CancellationToken cancellationToken = default) where T : class -{ - return FillTemplateAsync(outputStream, templateBytes, values, cancellationToken); -} -#endregion -} - diff --git a/src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs b/src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs index 80dca3d8..51d07e79 100644 --- a/src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs +++ b/src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs @@ -189,36 +189,4 @@ public async Task ExportAsync(Stream stream, object value, bool printHead return await writer.SaveAsAsync(progress, cancellationToken).ConfigureAwait(false); } - - /// - /// Modify the properties of a worksheet in the specified document. - /// - /// The path to the OpenXml document. - /// The name of the worksheet to modify. - /// The new name to assign to the worksheet, or null to leave as is. - /// The position in the workbook to assign to the worksheet, or null to leave as is. - /// The visibility state to assign to the worksheet, or null to leave as is. - /// The token to monitor for cancellation requests - [CreateSyncVersion] - [Obsolete("This method will be removed in the full release, please use MiniExcelV2.Editors.GetOpenXmlEditor().AlterSheetInfo instead.")] - public async Task AlterSheetAsync(string path, string sheetName, string? newSheetName = null, int? newSheetIndex = null, SheetState? newSheetState = null, CancellationToken cancellationToken = default) - { - await new OpenXmlEditor().AlterSheetInfoAsync(path, sheetName, newSheetName, newSheetIndex, newSheetState, cancellationToken).ConfigureAwait(false); - } - - /// - /// Modify the properties of a worksheet in the specified document. - /// - /// The stream to the OpenXml document. - /// The name of the worksheet to modify. - /// The new name to assign to the worksheet, or null to leave as is. - /// The position in the workbook to assign to the worksheet, or null to leave as is. - /// The visibility state to assign to the worksheet, or null to leave as is. - /// The token to monitor for cancellation requests - [CreateSyncVersion] - [Obsolete("This method will be removed in the full release, please use MiniExcelV2.Editors.GetOpenXmlEditor().AlterSheetInfo instead.")] - public async Task AlterSheetAsync(Stream stream, string sheetName, string? newSheetName = null, int? newSheetIndex = null, SheetState? newSheetState = null, CancellationToken cancellationToken = default) - { - await new OpenXmlEditor().AlterSheetInfoAsync(stream, sheetName, newSheetName, newSheetIndex, newSheetState, cancellationToken).ConfigureAwait(false); - } } From ab682f118645b9c806b69afe202f477a1fa3099a Mon Sep 17 00:00:00 2001 From: Michele Bastione Date: Sat, 21 Nov 2026 00:46:20 +0100 Subject: [PATCH 2/5] Removed obsolete MiniExcel class The class was previously renamed to MiniExcelV2 to avoid confusion with the namesake class containing the methods that preserve the signatures of the methods of the v1 API. It was marked as obsolete in the last pre-release version and now it's been removed for the full v2 release. --- src/MiniExcel.Core/MiniExcelV2.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/MiniExcel.Core/MiniExcelV2.cs b/src/MiniExcel.Core/MiniExcelV2.cs index 7fe2073c..e8a50229 100644 --- a/src/MiniExcel.Core/MiniExcelV2.cs +++ b/src/MiniExcel.Core/MiniExcelV2.cs @@ -10,12 +10,3 @@ public static class MiniExcelV2 public static readonly MiniExcelTemplaterProvider Templaters = new(); public static readonly MiniExcelEditorProvider Editors = new(); } - -[Obsolete("This class will be removed in the full release, use MiniExcelV2 instead.", true)] -public static class MiniExcel -{ - public static readonly MiniExcelExporterProvider Exporters = new(); - public static readonly MiniExcelImporterProvider Importers = new(); - public static readonly MiniExcelTemplaterProvider Templaters = new(); - public static readonly MiniExcelEditorProvider Editors = new(); -} From 3e54f0df32f4a8081a74595903bb4e703c97ed3d Mon Sep 17 00:00:00 2001 From: Michele Bastione Date: Sat, 21 Nov 2026 01:01:57 +0100 Subject: [PATCH 3/5] Removed obsolete ReadEmptyStringAsNull property from CsvConfiguration The property was used in previous pre-releases as facade for the more accurately named `ReadEmptyFieldsAsDefault` property. The actual `CsvConfiguration` facade class utilized to preserve the v1 API signatures was updated to include this facade property for backwards compatibility. --- src/MiniExcel.Csv/CsvConfiguration.cs | 7 ------- src/MiniExcel/Configuration.cs | 9 ++++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MiniExcel.Csv/CsvConfiguration.cs b/src/MiniExcel.Csv/CsvConfiguration.cs index 8f614bf8..3a4d8bfd 100644 --- a/src/MiniExcel.Csv/CsvConfiguration.cs +++ b/src/MiniExcel.Csv/CsvConfiguration.cs @@ -16,13 +16,6 @@ public class CsvConfiguration : MiniExcelBaseConfiguration /// Empty fields will be converted to null when queried as strings, or to the default value of the corresponding mapped type. /// public bool ReadEmptyFieldsAsDefault { get; set; } = false; - - [Obsolete("Please use the ReadEmptyFieldsAsDefault property instead")] - public bool ReadEmptyStringAsNull - { - get => ReadEmptyFieldsAsDefault; - set => ReadEmptyFieldsAsDefault = value; - } /// /// When set to true, rows with fewer columns than the header are padded with default values diff --git a/src/MiniExcel/Configuration.cs b/src/MiniExcel/Configuration.cs index 88028e39..e525b36f 100644 --- a/src/MiniExcel/Configuration.cs +++ b/src/MiniExcel/Configuration.cs @@ -12,5 +12,12 @@ public sealed class OpenXmlConfiguration : MiniExcelLib.OpenXml.OpenXmlConfigura namespace MiniExcelLibs.Csv { - public sealed class CsvConfiguration : MiniExcelLib.Csv.CsvConfiguration, IConfiguration; + public sealed class CsvConfiguration : MiniExcelLib.Csv.CsvConfiguration, IConfiguration + { + public bool ReadEmptyStringAsNull + { + get => ReadEmptyFieldsAsDefault; + set => ReadEmptyFieldsAsDefault = value; + } + } } From e073dfe0a9e5b40496323b28b296af9117ab369a Mon Sep 17 00:00:00 2001 From: Michele Bastione Date: Sat, 21 Nov 2026 01:09:31 +0100 Subject: [PATCH 4/5] Removed obsolete ExcelColumnName from MiniExcelColumnNameAttribute The property was used in previous pre-releases as facade for the simpler `Name` property. The `ExcelColumnNameAttribute` facade class utilized to preserve the v1 API signatures was updated to include this facade property for backwards compatibility. --- .../Attributes/MiniExcelColumnNameAttribute.cs | 2 -- src/MiniExcel/Attributes.cs | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/MiniExcel.Core/Attributes/MiniExcelColumnNameAttribute.cs b/src/MiniExcel.Core/Attributes/MiniExcelColumnNameAttribute.cs index cf2c74ba..6ea6d69a 100644 --- a/src/MiniExcel.Core/Attributes/MiniExcelColumnNameAttribute.cs +++ b/src/MiniExcel.Core/Attributes/MiniExcelColumnNameAttribute.cs @@ -6,8 +6,6 @@ public class MiniExcelColumnNameAttribute(string columnName, string[]? aliases = { private ResourceManager? _resourceManager; - [Obsolete("Please use the \"Name\" property instead")] - public string ExcelColumnName { get; set; } = columnName; public string Name { get; set; } = columnName; public string[] Aliases { get; set; } = aliases ?? []; diff --git a/src/MiniExcel/Attributes.cs b/src/MiniExcel/Attributes.cs index 6dc24a20..d9918476 100644 --- a/src/MiniExcel/Attributes.cs +++ b/src/MiniExcel/Attributes.cs @@ -13,7 +13,15 @@ public ExcelColumnIndexAttribute(int excelColumnIndex) : base(excelColumnIndex) public ExcelColumnIndexAttribute(string excelColumnName) : base(excelColumnName) { } } -public sealed class ExcelColumnNameAttribute(string excelColumnName) : MiniExcelColumnNameAttribute(columnName: excelColumnName); +public sealed class ExcelColumnNameAttribute(string excelColumnName) + : MiniExcelColumnNameAttribute(columnName: excelColumnName) +{ + public string ExcelColumnName + { + get => Name; + set => Name = value; + } +} public sealed class ExcelColumnWidthAttribute(double width) : MiniExcelColumnWidthAttribute(width); From 24b744445c90ea193c9db0e81230eed28a872df8 Mon Sep 17 00:00:00 2001 From: Michele Bastione Date: Sat, 21 Nov 2026 01:45:20 +0100 Subject: [PATCH 5/5] Updated dependencies --- src/Directory.Packages.props | 4 ++-- tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj | 4 ++-- .../MiniExcel.OpenXml.Tests.csproj | 11 ++++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 088e5b8a..ac2cfdd9 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -4,8 +4,8 @@ - - + + diff --git a/tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj b/tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj index fba820ec..083fc5ec 100644 --- a/tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj +++ b/tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj @@ -15,9 +15,9 @@ - + - + all diff --git a/tests/MiniExcel.OpenXml.Tests/MiniExcel.OpenXml.Tests.csproj b/tests/MiniExcel.OpenXml.Tests/MiniExcel.OpenXml.Tests.csproj index a056037d..1ef38181 100644 --- a/tests/MiniExcel.OpenXml.Tests/MiniExcel.OpenXml.Tests.csproj +++ b/tests/MiniExcel.OpenXml.Tests/MiniExcel.OpenXml.Tests.csproj @@ -14,12 +14,13 @@ - - - - + - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive