Soenneker.Json.CollectionConverter 11.0.879

Prefix Reserved
dotnet add package Soenneker.Json.CollectionConverter --version 11.0.879
                    
NuGet\Install-Package Soenneker.Json.CollectionConverter -Version 11.0.879
                    
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="Soenneker.Json.CollectionConverter" Version="11.0.879" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Json.CollectionConverter" Version="11.0.879" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Json.CollectionConverter" />
                    
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 Soenneker.Json.CollectionConverter --version 11.0.879
                    
#r "nuget: Soenneker.Json.CollectionConverter, 11.0.879"
                    
#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 Soenneker.Json.CollectionConverter@11.0.879
                    
#: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=Soenneker.Json.CollectionConverter&version=11.0.879
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Json.CollectionConverter&version=11.0.879
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Json.CollectionConverter

A System.Text.Json converter factory that applies an item converter to arrays and compatible generic collections.

Install

dotnet add package Soenneker.Json.CollectionConverter

Register

using System.Text.Json;
using System.Text.Json.Serialization;
using Soenneker.Json.CollectionConverter;

var options = new JsonSerializerOptions();
options.Converters.Add(
    new CollectionConverter<JsonStringEnumConverter>());

The generic argument must be a parameterless JsonConverter or JsonConverterFactory whose CanConvert() accepts the collection's item type.

Usage

DayOfWeek[] days =
    JsonSerializer.Deserialize<DayOfWeek[]>(
        "[\"Monday\",\"Friday\"]",
        options)!;

string json = JsonSerializer.Serialize(days, options);
// ["Monday","Friday"]

The factory handles one-dimensional arrays, concrete ICollection<T> implementations with a public parameterless constructor, compatible set interfaces through HashSet<T>, and compatible collection interfaces through List<T>.

Collections that can be enumerated but cannot be constructed are serialization-only; attempting to deserialize one throws NotImplementedException. Strings, dictionaries, multidimensional arrays, and types exposing conflicting IEnumerable<T> item types are not handled by this factory.

The item converter is inserted ahead of the copied serializer converter list for item reads and writes. Each CollectionConverter<TItemConverter> instance owns its item converter and compiled collection factories, so converter state is not shared between separate serializer configurations.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.879 132 11/11/2026
11.0.878 60 11/11/2026
11.0.877 66 11/11/2026
11.0.876 60 11/11/2026
11.0.875 307 10/27/2026
11.0.873 97 10/26/2026
11.0.872 97 10/26/2026
4.0.871 165 10/14/2026
4.0.870 103 10/14/2026
4.0.869 99 10/14/2026
4.0.868 101 10/14/2026
4.0.867 100 10/14/2026
4.0.861 101 10/13/2026
4.0.860 108 10/13/2026
4.0.859 106 10/12/2026
4.0.858 112 10/11/2026
4.0.857 109 10/11/2026
4.0.856 117 10/11/2026
4.0.855 148 10/6/2026
4.0.854 262 9/26/2026
Loading failed

Update dependency Soenneker.Extensions.Type to 11.0.725 (#1150)