Piotr Czajkowski 10 月之前
父節點
當前提交
88284568ff
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 2 2
      ExcelORM/ExcelORM/ExcelORM.csproj
  2. 2 3
      ExcelORM/ExcelORM/ExcelWriter.cs

+ 2 - 2
ExcelORM/ExcelORM/ExcelORM.csproj

@@ -4,7 +4,7 @@
         <TargetFramework>net7.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
         <Nullable>enable</Nullable>
-        <Version>2.0.1</Version>
+        <Version>2.1.0</Version>
         <PackageProjectUrl>https://git.liox.eu/pczajkowski/ExcelORM</PackageProjectUrl>
         <RepositoryUrl>https://github.com/pczajkowski/ExcelORM</RepositoryUrl>
         <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -14,7 +14,7 @@
 	<Authors>Piotr Czajkowski</Authors>
 	<Description>Simple library to read/write C# objects from/to Excel files. </Description>
 	<RepositoryType>GitHub</RepositoryType>
-	<PackageReleaseNotes>Handling less types, but better.</PackageReleaseNotes>
+	<PackageReleaseNotes>Added Skip attribute.</PackageReleaseNotes>
     </PropertyGroup>
 
     <ItemGroup>

+ 2 - 3
ExcelORM/ExcelORM/ExcelWriter.cs

@@ -28,8 +28,7 @@ public class ExcelWriter
 
     private static void Write<T>(IEnumerable<T> values, IXLWorksheet worksheet, bool append) where T : class, new()
     {
-        var enumerable = values as T[] ?? values.ToArray();
-        if (!enumerable.Any()) return;
+        if (!values.Any()) return;
 
         var rowIndex = append switch
         {
@@ -37,7 +36,7 @@ public class ExcelWriter
             false => GenerateHeader<T>(worksheet),
         };
 
-        foreach (var value in enumerable)
+        foreach (var value in values)
         {
             var cellIndex = 0;
             var properties = typeof(T).GetProperties();