RCommon.Json 2.4.1

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package RCommon.Json --version 2.4.1
                    
NuGet\Install-Package RCommon.Json -Version 2.4.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="RCommon.Json" Version="2.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCommon.Json" Version="2.4.1" />
                    
Directory.Packages.props
<PackageReference Include="RCommon.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 RCommon.Json --version 2.4.1
                    
#r "nuget: RCommon.Json, 2.4.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.
#:package RCommon.Json@2.4.1
                    
#: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=RCommon.Json&version=2.4.1
                    
Install as a Cake Addin
#tool nuget:?package=RCommon.Json&version=2.4.1
                    
Install as a Cake Tool

RCommon.Json

Provides the JSON serialization abstraction layer for RCommon. This package defines the IJsonSerializer interface and configuration options, allowing your application to serialize and deserialize JSON without coupling to a specific library.

Features

  • IJsonSerializer interface with generic and non-generic serialize/deserialize methods
  • JsonSerializeOptions for controlling camelCase naming and indented output
  • JsonDeserializeOptions for controlling camelCase naming during deserialization
  • IJsonBuilder interface for pluggable DI registration of JSON providers
  • Fluent WithJsonSerialization<T>() extension method on IRCommonBuilder for easy setup

Installation

dotnet add package RCommon.Json

Usage

This package is typically not used directly. Instead, install a concrete implementation such as RCommon.JsonNet or RCommon.SystemTextJson and register it through the RCommon builder:

using RCommon;
using RCommon.Json;

services.AddRCommon(builder =>
{
    // Use one of the concrete implementations:
    // builder.WithJsonSerialization<JsonNetBuilder>();
    // builder.WithJsonSerialization<TextJsonBuilder>();
});

Once registered, inject IJsonSerializer anywhere in your application:

public class MyService
{
    private readonly IJsonSerializer _serializer;

    public MyService(IJsonSerializer serializer)
    {
        _serializer = serializer;
    }

    public string ToJson(Order order)
    {
        return _serializer.Serialize(order, new JsonSerializeOptions
        {
            CamelCase = true,
            Indented = true
        });
    }

    public Order FromJson(string json)
    {
        return _serializer.Deserialize<Order>(json);
    }
}

Key Types

Type Description
IJsonSerializer Abstraction for JSON serialization and deserialization operations
JsonSerializeOptions Options for camelCase naming and indented formatting during serialization
JsonDeserializeOptions Options for camelCase naming during deserialization
IJsonBuilder Builder interface for registering a JSON provider into DI
JsonBuilderExtensions Extension methods providing WithJsonSerialization<T>() on IRCommonBuilder

Documentation

For full documentation, visit rcommon.com.

License

Licensed under the Apache License, Version 2.0.

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on RCommon.Json:

Package Downloads
RCommon.MemoryCache

A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more

RCommon.JsonNet

A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more

RCommon.RedisCache

A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more

RCommon.SystemTextJson

A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.2-alpha.0.10 80 4/5/2026
2.4.2-alpha.0.9 60 3/26/2026
2.4.2-alpha.0.8 59 3/26/2026
2.4.2-alpha.0.7 55 3/26/2026
2.4.2-alpha.0.6 60 3/25/2026
2.4.2-alpha.0.5 59 3/24/2026
2.4.2-alpha.0.1 56 3/24/2026
2.4.1 221 2/18/2026
2.3.2-alpha.0.3 69 2/18/2026
2.3.2-alpha.0.2 66 2/18/2026
2.3.2-alpha.0.1 78 2/9/2026
2.3.1 283 2/5/2026
2.3.0 207 2/3/2026
2.2.2-alpha.0.1 411 12/11/2025
2.2.1-alpha.0.2 156 10/24/2025
2.2.1-alpha.0.1 156 10/24/2025
2.1.11-alpha.0.2 149 10/24/2025
2.1.11-alpha.0.1 126 7/18/2025
2.1.10 392 7/17/2025
2.1.9-alpha.0.1 171 7/17/2025
Loading failed