jcoliz.OpenOfficeXml.Serializer 1.0.3

dotnet add package jcoliz.OpenOfficeXml.Serializer --version 1.0.3
                    
NuGet\Install-Package jcoliz.OpenOfficeXml.Serializer -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="jcoliz.OpenOfficeXml.Serializer" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="jcoliz.OpenOfficeXml.Serializer" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="jcoliz.OpenOfficeXml.Serializer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add jcoliz.OpenOfficeXml.Serializer --version 1.0.3
                    
#r "nuget: jcoliz.OpenOfficeXml.Serializer, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package jcoliz.OpenOfficeXml.Serializer@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=jcoliz.OpenOfficeXml.Serializer&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=jcoliz.OpenOfficeXml.Serializer&version=1.0.3
                    
Install as a Cake Tool

Office Open XML Serializer

This is a .NET Standard 2.1 library designed to make it easy to serialize C# objects from/to Office Open XML spreadsheet documents.

Background

Sometimes you just need to read and write objects to or from a spreadsheet. Perhaps you're looking for a simple library to handle all the low-level details required by the Office Open XML SDK.

Usage

Namespace

using jcoliz.OpenOfficeXml.Serializer;

Simple Serialization

void WriteToSpreadsheet<T>(Stream stream, IEnumerable<T> items) where T: class
{
    using var writer = new SpreadsheetWriter();
    writer.Open(stream);
    writer.Serialize(items);
}

Simple Deserialization

IEnumerable<T> ReadFromSpreadsheet<T>(Stream stream) where T : class, new()
{
    using var reader = new SpreadsheetReader();
    reader.Open(stream);
    return reader.Deserialize<T>();
}

Sheet Names

Select the sheet name to write into

writer.Serialize(items, "MySheet");

Discover the sheets available in a spreadsheet

foreach(var sheet in reader.SheetNames)
    Console.WriteLine(sheet);

Choose which to deserialize from

reader.Deserialize<T>("MySheet")

Exclude Properties on Deserialize

You may want to avoid reading in certain properties. For example, I typically don't want Entity Framework IDs imported from spreadsheets.

var items = reader.Deserialize<T>(exceptproperties: new string[] { "ID" });
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 1,368 8/26/2023
1.0.2 1,672 12/6/2021
1.0.1 3,584 11/25/2021
1.0.1-rc1 3,525 11/25/2021
1.0.0 994 11/21/2021
0.9.0-rc9 880 11/21/2021
0.9.0-rc7 872 11/21/2021
0.9.0-rc6 905 11/21/2021
0.9.0-rc5 866 11/21/2021
0.9.0-rc16 388 11/22/2021
0.9.0-rc15 471 11/21/2021

Fix issue #2: Nullable properties were not being deserialized