StrongOf.Json 2.1.8

There is a newer version of this package available.
See the version list below for details.

Requires NuGet 2.12 or higher.

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

StrongOf.Json

System.Text.Json converters for StrongOf types.

Available Converters

Converter For
StrongGuidJsonConverter<T> StrongGuid<T> types
StrongStringJsonConverter<T> StrongString<T> types
StrongInt32JsonConverter<T> StrongInt32<T> types
StrongInt64JsonConverter<T> StrongInt64<T> types
StrongDecimalJsonConverter<T> StrongDecimal<T> types
StrongCharJsonConverter<T> StrongChar<T> types
StrongDateTimeJsonConverter<T> StrongDateTime<T> types
StrongDateTimeOffsetJsonConverter<T> StrongDateTimeOffset<T> types

Usage - Attribute

Decorate properties directly:

public sealed class UserDto
{
    [JsonConverter(typeof(StrongGuidJsonConverter<UserId>))]
    public UserId Id { get; set; }

    [JsonConverter(typeof(StrongStringJsonConverter<EmailAddress>))]
    public EmailAddress Email { get; set; }
}

Usage - JsonSerializerOptions

Or register converters globally:

JsonSerializerOptions options = new()
{
    WriteIndented = true,
    Converters =
    {
        new StrongGuidJsonConverter<UserId>(),
        new StrongStringJsonConverter<EmailAddress>(),
    }
};

string json = JsonSerializer.Serialize(user, options);
UserDto dto = JsonSerializer.Deserialize<UserDto>(json, options)!;

Installation

dotnet add package StrongOf.Json

GitHub

See https://github.com/BenjaminAbt/StrongOf

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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 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.  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
2.1.26 86 3/7/2026
2.1.8 87 2/28/2026
1.2.15 2,612 4/26/2025
1.2.8 375 4/9/2025
1.2.7 2,401 2/18/2025
1.2.7-ga639164e54 179 2/18/2025
1.2.4 1,799 11/28/2024
1.2.4-g0988d2c02d 176 11/28/2024
1.2.2 566 11/15/2024
1.2.2-gbc3f3048e7 150 11/15/2024
1.1.4 545 11/12/2024
1.1.4-g6e854f6d6d 143 11/12/2024
1.1.2 233 11/5/2024
1.1.2-g0a1a51912f 137 11/5/2024
0.1.71 291 11/3/2024
0.1.71-g40ec49b665 178 11/3/2024
0.1.65 5,404 6/2/2024
0.1.65-g31f777a546 198 6/2/2024
0.1.63 199 6/1/2024
0.1.63-g3ca390c476 181 6/1/2024
Loading failed