Neemle.XJson.Abstractions
1.0.2
dotnet add package Neemle.XJson.Abstractions --version 1.0.2
NuGet\Install-Package Neemle.XJson.Abstractions -Version 1.0.2
<PackageReference Include="Neemle.XJson.Abstractions" Version="1.0.2" />
<PackageVersion Include="Neemle.XJson.Abstractions" Version="1.0.2" />
<PackageReference Include="Neemle.XJson.Abstractions" />
paket add Neemle.XJson.Abstractions --version 1.0.2
#r "nuget: Neemle.XJson.Abstractions, 1.0.2"
#:package Neemle.XJson.Abstractions@1.0.2
#addin nuget:?package=Neemle.XJson.Abstractions&version=1.0.2
#tool nuget:?package=Neemle.XJson.Abstractions&version=1.0.2
Neemle.XJson.Abstractions — attributes for XJson
This package contains the public attributes used by the XJson incremental source generator.
It is a tiny, runtime‑only dependency that you reference from the projects that define your
models. The generator itself lives in a separate package (Neemle.XJson.Generator).
What’s inside
Neemle.XJson.Abstractions.XJsonAttribute— apply to classes or structs to opt‑in for reflection‑free JSON code generation.
Target frameworks: net8.0
Install
Using NuGet packages (recommended):
<ItemGroup>
<PackageReference Include="Neemle.XJson.Abstractions" />
<PackageReference Include="Neemle.XJson.Generator"
PrivateAssets="all"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
Quick start
Annotate the models you want generated converters for with [XJson].
using System.Text.Json.Serialization;
using Neemle.XJson.Abstractions;
[XJson]
public class Person
{
[JsonPropertyName("a")] // attribute name wins over any naming policy
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public int Age { get; set; }
}
Then, in your consuming code, use the generated helper from Neemle.XJson.Generated (see the
root XJson README for full API and options):
using Neemle.XJson.Generated; // exposes static Json helper
var json = Json.Encode(new Person { Name = "Ada", Surname = "Lovelace", Age = 36 });
var copy = Json.Decode<Person>(json);
Notes
[XJson]can be placed on classes or structs.- This package contains no runtime reflection and is trimming / NativeAOT friendly.
- For configuration, error‑tolerant decode, and more examples, see the root project README in the XJson repository.
- During design-time builds (e.g., IntelliSense), a small stub for
Neemle.XJson.Generated.Jsonis included to prevent missing-type errors; it is excluded from normal builds so runtime stays reflection-free.
License
MIT — see the LICENSE file in the repository.
| 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 was computed. 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 was computed. 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. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Neemle.XJson.Abstractions:
| Package | Downloads |
|---|---|
|
Neemle.XSettings
Reflection-free configuration loader with JSON persistence and EnvSettings overrides; trim/AOT friendly. |
GitHub repositories
This package is not used by any popular GitHub repositories.