jcoliz.OpenOfficeXml.Serializer 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package jcoliz.OpenOfficeXml.Serializer --version 1.0.1                
NuGet\Install-Package jcoliz.OpenOfficeXml.Serializer -Version 1.0.1                
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.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add jcoliz.OpenOfficeXml.Serializer --version 1.0.1                
#r "nuget: jcoliz.OpenOfficeXml.Serializer, 1.0.1"                
#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.
// Install jcoliz.OpenOfficeXml.Serializer as a Cake Addin
#addin nuget:?package=jcoliz.OpenOfficeXml.Serializer&version=1.0.1

// Install jcoliz.OpenOfficeXml.Serializer as a Cake Tool
#tool nuget:?package=jcoliz.OpenOfficeXml.Serializer&version=1.0.1                

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. 
.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,076 8/26/2023
1.0.2 1,558 12/6/2021
1.0.1 3,503 11/25/2021
1.0.1-rc1 3,451 11/25/2021
1.0.0 913 11/21/2021
0.9.0-rc9 802 11/21/2021
0.9.0-rc7 798 11/21/2021
0.9.0-rc6 831 11/21/2021
0.9.0-rc5 790 11/21/2021
0.9.0-rc16 310 11/22/2021
0.9.0-rc15 395 11/21/2021

Internal code cleanups only. No change in functionality.