Mugi.Reflection 0.1.3

dotnet add package Mugi.Reflection --version 0.1.3
                    
NuGet\Install-Package Mugi.Reflection -Version 0.1.3
                    
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="Mugi.Reflection" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mugi.Reflection" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Mugi.Reflection" />
                    
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 Mugi.Reflection --version 0.1.3
                    
#r "nuget: Mugi.Reflection, 0.1.3"
                    
#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 Mugi.Reflection@0.1.3
                    
#: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=Mugi.Reflection&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Mugi.Reflection&version=0.1.3
                    
Install as a Cake Tool

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 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. 
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
0.1.3 100 8/28/2026
0.1.2 88 8/28/2026