Skip to content

Commit

Permalink
net7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaddon committed Nov 9, 2022
1 parent 8bd9170 commit 78a58d4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ArrayToExcel/ArrayToExcel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static CellValue GetCellValue(object? value)
if (type == typeof(float))
return new(((float)value).ToString(_cultureInfo));

return new(_invalidXmlChars.Replace(value.ToString(), string.Empty));
return new(_invalidXmlChars.Replace(value.ToString()!, string.Empty));
}

static InlineString GetInlineString(string value)
Expand Down
10 changes: 5 additions & 5 deletions ArrayToExcel/ArrayToExcel.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\ArrayToExcel.snk</AssemblyOriginatorKeyFile>
<AssemblyVersion>2.2.0</AssemblyVersion>
<FileVersion>2.2.0</FileVersion>
<Version>2.2.0</Version>
<AssemblyVersion>2.2.1</AssemblyVersion>
<FileVersion>2.2.1</FileVersion>
<Version>2.2.1</Version>
<Company></Company>
<Authors>Leonid Salavatov</Authors>
<Copyright>Leonid Salavatov 2022</Copyright>
<PackageId>ArrayToExcel</PackageId>
<Product>ArrayToExcel</Product>
<Title>ArrayToExcel</Title>
<Description>Create Excel from Array (List, DataTable, DataSet, ...)</Description>
<PackageTags>excel xlsx array2excel arraytoexcel array list dataset datatable convert map mapping dotnet</PackageTags>
<PackageTags>excel xlsx array2excel arraytoexcel array list dataset datatable convert map mapping</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageProjectUrl>https://github.com/mustaddon/ArrayToExcel</PackageProjectUrl>
<RepositoryUrl>https://github.com/mustaddon/ArrayToExcel</RepositoryUrl>
Expand Down
21 changes: 13 additions & 8 deletions ArrayToExcel/SchemaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,20 @@ private List<ColumnSchema> DefaultColumns(IEnumerable items)

var result = new List<ColumnSchema>();

while (dict?.MoveNext() == true)
{
var key = dict.Key;
result.Add(new()
if(dict != null)
while (dict.MoveNext() == true)
{
Name = key.ToString(),
Value = new(x => (x as IDictionary)?[key]),
});
}
var key = dict.Key;

if (key == null)
continue;

result.Add(new()
{
Name = key.ToString()!,
Value = new(x => (x as IDictionary)?[key]),
});
}

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example.ConsoleApp/Example.ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down

0 comments on commit 78a58d4

Please sign in to comment.