RCommon.SystemTextJson
2.4.1
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RCommon.SystemTextJson --version 2.4.1
NuGet\Install-Package RCommon.SystemTextJson -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.SystemTextJson" Version="2.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCommon.SystemTextJson" Version="2.4.1" />
<PackageReference Include="RCommon.SystemTextJson" />
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.SystemTextJson --version 2.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RCommon.SystemTextJson, 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.SystemTextJson@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.SystemTextJson&version=2.4.1
#tool nuget:?package=RCommon.SystemTextJson&version=2.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RCommon.SystemTextJson
System.Text.Json implementation of RCommon's IJsonSerializer abstraction. This package registers TextJsonSerializer into the dependency injection container and provides fluent configuration of JsonSerializerOptions, along with custom enum converters.
Features
- Implements
IJsonSerializerusing the built-in System.Text.Json library - Per-call options for camelCase property naming and indented formatting
- Fluent configuration of
JsonSerializerOptionsthrough the builder pattern - Custom
JsonByteEnumConverter<T>for serializing enums as byte values - Custom
JsonIntEnumConverter<T>for serializing enums as int values - Integrates with RCommon's
AddRCommon()/WithJsonSerialization<T>()pipeline - Registered as a transient service in the DI container
Installation
dotnet add package RCommon.SystemTextJson
Usage
Register the System.Text.Json serializer through the RCommon builder:
using RCommon;
using RCommon.SystemTextJson;
services.AddRCommon(builder =>
{
builder.WithJsonSerialization<TextJsonBuilder>(serializer =>
{
serializer.Configure(options =>
{
options.DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull;
options.Converters.Add(new JsonIntEnumConverter<MyEnum>());
});
});
});
Then inject and use IJsonSerializer in your services:
public class OrderService
{
private readonly IJsonSerializer _serializer;
public OrderService(IJsonSerializer serializer)
{
_serializer = serializer;
}
public string SerializeOrder(Order order)
{
return _serializer.Serialize(order);
}
}
Key Types
| Type | Description |
|---|---|
TextJsonSerializer |
IJsonSerializer implementation backed by System.Text.Json |
TextJsonBuilder |
Registers TextJsonSerializer into the DI container |
ITextJsonBuilder |
Builder interface for System.Text.Json-specific configuration |
ITextJsonBuilderExtensions |
Provides Configure(Action<JsonSerializerOptions>) for customizing serializer options |
JsonIntEnumConverter<T> |
Custom converter that serializes enums as their int numeric value |
JsonByteEnumConverter<T> |
Custom converter that serializes enums as their byte numeric value |
Documentation
For full documentation, visit rcommon.com.
Related Packages
- RCommon.Json - JSON serialization abstractions (IJsonSerializer, options)
- RCommon.JsonNet - Alternative implementation using Newtonsoft.Json
License
Licensed under the Apache License, Version 2.0.
| Product | Versions 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.
-
net10.0
- RCommon.Json (>= 2.4.1)
-
net8.0
- RCommon.Json (>= 2.4.1)
-
net9.0
- RCommon.Json (>= 2.4.1)
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.4.2-alpha.0.6 | 0 | 3/25/2026 |
| 2.4.2-alpha.0.5 | 30 | 3/24/2026 |
| 2.4.2-alpha.0.1 | 33 | 3/24/2026 |
| 2.4.1 | 91 | 2/18/2026 |
| 2.3.2-alpha.0.3 | 48 | 2/18/2026 |
| 2.3.2-alpha.0.2 | 44 | 2/18/2026 |
| 2.3.2-alpha.0.1 | 50 | 2/9/2026 |
| 2.3.1 | 96 | 2/5/2026 |
| 2.3.0 | 90 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 394 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 147 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 139 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 136 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 113 | 7/18/2025 |
| 2.1.10 | 217 | 7/17/2025 |
| 2.1.9-alpha.0.1 | 158 | 7/17/2025 |
| 2.1.2.4 | 235 | 5/21/2025 |
| 2.1.2.3 | 198 | 5/1/2025 |
| 2.1.2.2 | 178 | 1/23/2025 |
| 0.0.0-alpha.0 | 154 | 7/17/2025 |
Loading failed