ActDim.Practix.Json
1.0.1
There is a newer version of this package available.
See the version list below for details.
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" />
<PackageReference Include="ActDim.Practix.Json" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=ActDim.Practix.Json&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.Reflectronto bypass standard reflection overhead. - Advanced Custom Converters: Standardized converters for
Exceptionobjects, 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 | Versions 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.
-
net10.0
- ActDim.Practix.Abstractions (>= 1.0.1)
- ActDim.Practix.Common (>= 1.0.1)
- Ardalis.GuardClauses (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.