Mugi.Reflection
0.1.3
dotnet add package Mugi.Reflection --version 0.1.3
NuGet\Install-Package Mugi.Reflection -Version 0.1.3
<PackageReference Include="Mugi.Reflection" Version="0.1.3" />
<PackageVersion Include="Mugi.Reflection" Version="0.1.3" />
<PackageReference Include="Mugi.Reflection" />
paket add Mugi.Reflection --version 0.1.3
#r "nuget: Mugi.Reflection, 0.1.3"
#:package Mugi.Reflection@0.1.3
#addin nuget:?package=Mugi.Reflection&version=0.1.3
#tool nuget:?package=Mugi.Reflection&version=0.1.3
Mugi.Reflection
Mugi.Reflection is an opt-in fallback for the Mugi web framework that creates JSON codecs from public properties and constructors at runtime, using reflection. Use it when neither the Mugi.Generators source generator nor the mugi-gen tool fits your build setup.
Usage
<ItemGroup>
<PackageReference Include="Mugi.Reflection" Version="0.1.3" />
</ItemGroup>
Enable the fallback once during startup:
using Mugi.Reflection;
ReflectionCodecs.Enable();
The fallback is disabled by default. Once enabled, c.Json(...) and c.Req.Json<T>() work for types that have no generated or registered codec. It supports the same shapes as generated codecs: primitive values, string, Guid, DateTime, DateTimeOffset, decimal, enums, nullable values, arrays, List<T>, Dictionary<string, T>, POCOs, and records, with camel-case property names.
When not to use it
Mugi.Reflection does not support NativeAOT, which is the main deployment target of Mugi. When publishing with AOT, use the generated codecs from Mugi.Generators or mugi-gen instead. A generated or hand-registered codec always takes precedence over the reflection fallback, so adding this package does not change existing behavior.
Full documentation is at github.com/hckaye/Mugi.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
-
net9.0
- Mugi.Json (>= 0.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.