- [New] Query dynamic with first head will ignore blank/whitespace columns
- [New] Query type mapping support Custom POCO excel column name/ignore attribute
This commit is contained in:
wei 2021-04-02 18:07:23 +08:00
parent 77cf5f2feb
commit 9df9e51946
7 changed files with 24 additions and 37 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -24,6 +24,6 @@
<RepositoryType>Github</RepositoryType>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
</Project>

View File

@ -1,16 +0,0 @@
namespace MiniExcelLibs.Utils
{
using System;
internal static partial class Helpers
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public class ExcelColumnNameAttribute : Attribute
{
public string ExcelColumnName { get; set; }
public ExcelColumnNameAttribute(string excelColumnName) => ExcelColumnName = excelColumnName;
}
}
}

View File

@ -1,16 +0,0 @@
namespace MiniExcelLibs.Utils
{
using System;
internal static partial class Helpers
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
public class ExcelIgnoreAttribute : Attribute
{
public bool ExcelIgnore { get; set; }
public ExcelIgnoreAttribute(bool excelIgnore = true) => ExcelIgnore = excelIgnore;
}
}
}

View File

@ -1,5 +1,6 @@
namespace MiniExcelLibs.Utils
{
using MiniExcelLibs.Attributes;
using System;
using System.Collections;
using System.Collections.Generic;

View File

@ -11,12 +11,9 @@ using System.Collections.Generic;
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
{