Skip to content

Commit

Permalink
0.10.0
Browse files Browse the repository at this point in the history
- [New] Query dynamic with first head will ignore blank/whitespace columns
- [New] Query type mapping support Custom POCO excel column name/ignore attribute
  • Loading branch information
shps951023 committed Apr 2, 2021
1 parent 77cf5f2 commit 9df9e51
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 37 deletions.
10 changes: 10 additions & 0 deletions src/MiniExcel/Attributes/ExcelColumnNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace MiniExcelLibs.Attributes
{
using System;
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public class ExcelColumnNameAttribute : Attribute
{
public string ExcelColumnName { get; set; }
public ExcelColumnNameAttribute(string excelColumnName) => ExcelColumnName = excelColumnName;
}
}
11 changes: 11 additions & 0 deletions src/MiniExcel/Attributes/ExcelIgnoreAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace MiniExcelLibs.Attributes
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public class ExcelIgnoreAttribute : Attribute
{
public bool ExcelIgnore { get; set; }
public ExcelIgnoreAttribute(bool excelIgnore = true) => ExcelIgnore = excelIgnore;
}
}
2 changes: 1 addition & 1 deletion src/MiniExcel/MiniExcelLibs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<RepositoryType>Github</RepositoryType>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
</Project>
16 changes: 0 additions & 16 deletions src/MiniExcel/Utils/ExcelColumnNameAttribute.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/MiniExcel/Utils/ExcelIgnoreAttribute.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/MiniExcel/Utils/Helpers.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace MiniExcelLibs.Utils
{
using MiniExcelLibs.Attributes;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
5 changes: 1 addition & 4 deletions tests/MiniExcelTests/MiniExcelOpenXmlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@
using System.Data.SQLite;
using Dapper;
using System.Globalization;
using System.IO.Compression;
using System.Text;
using System.Xml.Linq;
using static MiniExcelLibs.Tests.Utils.MiniExcelOpenXml;
using MiniExcelLibs.Tests.Utils;
using static MiniExcelLibs.Utils.Helpers;
using MiniExcelLibs.Attributes;

namespace MiniExcelLibs.Tests
{
Expand Down

0 comments on commit 9df9e51

Please sign in to comment.