ActDim.Practix.Json 1.0.1

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

ActDim.Practix.Json

ActDim.Practix.Json is a high-performance JSON serialization subsystem for the ActDim.Practix framework built on top of System.Text.Json and optimized using ActDim.Reflectron expression tree property setters and cached type metadata.

Features

  • Reflectron-Optimized Deserialization: Leverages fast compiled expression-tree property setters and metadata caching via ActDim.Reflectron to bypass standard reflection overhead.
  • Advanced Custom Converters: Standardized converters for Exception objects, floating-point numbers, number-backed enums, implicit operators, runtime type polymorphism, and Newtonsoft-compatible string parsing.
  • Custom Naming Policies & Resolvers: Configurable naming policies (LowerCaseNamingPolicy, UpperCaseNamingPolicy, NamingPolicyResolver) and type contract resolvers.
  • Declarative Attributes:
    • [JsonDefaultValue(value)]: Specify fallback default property values.
    • [JsonIgnoreDefault]: Omit properties carrying default target values during serialization.
    • [JsonIgnoreEmpty]: Ignore empty collections, arrays, and dictionaries.
    • [JsonNaming(namingPolicy)]: Per-class or per-property naming policy overriding.
  • Microsoft Dependency Injection Support: Simple DI registration via services.AddPractixJson().

Installation

Install via the .NET CLI:

dotnet add package ActDim.Practix.Json

Or via Package Manager Console:

Install-Package ActDim.Practix.Json

Dependency Injection Setup

Register CoreJsonSerializer as IJsonSerializer in Microsoft Dependency Injection:

using ActDim.Practix.Json.Extensions;
using Microsoft.Extensions.DependencyInjection;

public void ConfigureServices(IServiceCollection services)
{
    services.AddPractixJson();
}

Usage Examples

1. Basic Serialization & Deserialization

using ActDim.Practix.Abstractions.Json;
using ActDim.Practix.Json.Extensions;
using Microsoft.Extensions.DependencyInjection;

var serializer = serviceProvider.GetRequiredService<IJsonSerializer>();

var user = new UserProfile { Id = 42, Name = "Alice", Email = "alice@example.com" };

// Serialize to JSON string
string json = serializer.Serialize(user);

// Deserialize from JSON string
UserProfile restoredUser = serializer.Deserialize<UserProfile>(json);

2. Using Custom Attributes

using ActDim.Practix.Json;
using System.Collections.Generic;

public class APIResponse
{
    [JsonIgnoreEmpty]
    public List<string> Warnings { get; set; } = new List<string>();

    [JsonIgnoreDefault]
    public int RetryCount { get; set; } = 0;

    [JsonDefaultValue("SUCCESS")]
    public string Status { get; set; }
}

License

This project is licensed under the MIT License.

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

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
1.0.10 31 8/26/2026
1.0.9 68 8/25/2026
1.0.8 60 8/25/2026
1.0.7 93 8/20/2026
1.0.6 86 8/19/2026
1.0.5 83 8/19/2026
1.0.4 89 8/19/2026
1.0.3 92 8/18/2026
1.0.2 88 8/18/2026
1.0.1 88 8/17/2026
1.0.0 91 8/17/2026