Soenneker.Json.CollectionConverter 4.0.845

Prefix Reserved
dotnet add package Soenneker.Json.CollectionConverter --version 4.0.845
                    
NuGet\Install-Package Soenneker.Json.CollectionConverter -Version 4.0.845
                    
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="4.0.845" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Json.CollectionConverter" Version="4.0.845" />
                    
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 4.0.845
                    
#r "nuget: Soenneker.Json.CollectionConverter, 4.0.845"
                    
#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@4.0.845
                    
#: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=4.0.845
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Json.CollectionConverter&version=4.0.845
                    
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 net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Json.CollectionConverter:

Package Downloads
Soenneker.Blazor.TomSelect

A Blazor interop library for the select user control library, Tom Select

Soenneker.Blazor.Chatwoot

A Blazor interop library for Chatwoot, the open-source customer engagement suite.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.845 618 8/30/2026
4.0.844 136 8/30/2026
4.0.843 156 8/30/2026
4.0.842 132 8/29/2026
4.0.841 131 8/29/2026
4.0.840 84 8/29/2026
4.0.839 168 8/29/2026
4.0.838 608 8/25/2026
4.0.837 3,052 7/28/2026
4.0.836 185 7/28/2026
4.0.835 104 7/28/2026
4.0.834 1,360 7/17/2026
4.0.833 109 7/16/2026
4.0.832 110 7/16/2026
4.0.831 2,671 6/19/2026
4.0.830 1,084 6/18/2026
4.0.828 2,071 6/5/2026
4.0.827 117 6/5/2026
4.0.826 236 6/5/2026
4.0.825 121 6/5/2026
Loading failed

Isolate collection converter caches