Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.Memory" Version="10.0.7" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.7" />
<PackageReference Include="Microsoft.Bcl.Memory" Version="11.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="11.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
2 changes: 0 additions & 2 deletions src/MiniExcel.Core/Attributes/MiniExcelColumnNameAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? [];

Expand Down
9 changes: 0 additions & 9 deletions src/MiniExcel.Core/MiniExcelV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
7 changes: 0 additions & 7 deletions src/MiniExcel.Csv/CsvConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
public bool ReadEmptyFieldsAsDefault { get; set; } = false;

[Obsolete("Please use the ReadEmptyFieldsAsDefault property instead")]
public bool ReadEmptyStringAsNull
{
get => ReadEmptyFieldsAsDefault;
set => ReadEmptyFieldsAsDefault = value;
}

/// <summary>
/// When set to true, rows with fewer columns than the header are padded with default values
Expand Down
34 changes: 0 additions & 34 deletions src/MiniExcel.OpenXml.FluentMapping/Api/MappingTemplater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,38 +75,4 @@ public async Task FillTemplateAsync<T>(

await FillTemplateAsync(outputStream, templateStream, values, cancellationToken).ConfigureAwait(false);
}

#region Obsolete
[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")]
public Task ApplyTemplateAsync<T>(
string? outputPath,
string? templatePath,
IEnumerable<T>? values,
CancellationToken cancellationToken = default) where T : class
{
return FillTemplateAsync(outputPath, templatePath, values, cancellationToken);
}

[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")]
public Task ApplyTemplateAsync<T>(
Stream? outputStream,
Stream? templateStream,
IEnumerable<T>? values,
CancellationToken cancellationToken = default) where T : class
{
return FillTemplateAsync(outputStream, templateStream, values, cancellationToken);
}


[CreateSyncVersion, Obsolete("Please use FillTemplate or FillTemplateAsync instead.")]
public Task ApplyTemplateAsync<T>(
Stream? outputStream,
byte[]? templateBytes,
IEnumerable<T>? values,
CancellationToken cancellationToken = default) where T : class
{
return FillTemplateAsync(outputStream, templateBytes, values, cancellationToken);
}
#endregion
}

32 changes: 0 additions & 32 deletions src/MiniExcel.OpenXml/Api/OpenXmlExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,36 +189,4 @@ public async Task<int[]> ExportAsync(Stream stream, object value, bool printHead

return await writer.SaveAsAsync(progress, cancellationToken).ConfigureAwait(false);
}

/// <summary>
/// Modify the properties of a worksheet in the specified document.
/// </summary>
/// <param name="path">The path to the OpenXml document.</param>
/// <param name="sheetName">The name of the worksheet to modify.</param>
/// <param name="newSheetName">The new name to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="newSheetIndex">The position in the workbook to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="newSheetState">The visibility state to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests</param>
[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);
}

/// <summary>
/// Modify the properties of a worksheet in the specified document.
/// </summary>
/// <param name="stream">The stream to the OpenXml document.</param>
/// <param name="sheetName">The name of the worksheet to modify.</param>
/// <param name="newSheetName">The new name to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="newSheetIndex">The position in the workbook to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="newSheetState">The visibility state to assign to the worksheet, or <c>null</c> to leave as is.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests</param>
[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);
}
}
10 changes: 9 additions & 1 deletion src/MiniExcel/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 8 additions & 1 deletion src/MiniExcel/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
4 changes: 2 additions & 2 deletions tests/MiniExcel.Csv.Tests/MiniExcel.Csv.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.9" Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="11.0.0" Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.12.0" />
<PackageReference Include="xunit" Version="2.9.3"/>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
11 changes: 6 additions & 5 deletions tests/MiniExcel.OpenXml.Tests/MiniExcel.OpenXml.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClosedXML" Version="0.105.0" />
<PackageReference Include="ExcelDataReader" Version="3.8.0" />
<PackageReference Include="ExcelDataReader.DataSet" Version="3.8.0" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.9" Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="11.0.0" Condition="'$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0'" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="ClosedXML" Version="0.105.1" />
<PackageReference Include="ExcelDataReader" Version="3.9.0" />
<PackageReference Include="ExcelDataReader.DataSet" Version="3.9.0" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Loading