Pocok.Conversion
0.2.0-alpha.7
Prefix Reserved
dotnet add package Pocok.Conversion --version 0.2.0-alpha.7
NuGet\Install-Package Pocok.Conversion -Version 0.2.0-alpha.7
<PackageReference Include="Pocok.Conversion" Version="0.2.0-alpha.7" />
<PackageVersion Include="Pocok.Conversion" Version="0.2.0-alpha.7" />
<PackageReference Include="Pocok.Conversion" />
paket add Pocok.Conversion --version 0.2.0-alpha.7
#r "nuget: Pocok.Conversion, 0.2.0-alpha.7"
#:package Pocok.Conversion@0.2.0-alpha.7
#addin nuget:?package=Pocok.Conversion&version=0.2.0-alpha.7&prerelease
#tool nuget:?package=Pocok.Conversion&version=0.2.0-alpha.7&prerelease
Pocok.Conversion
Pocok.Conversion converts runtime values without process-global registration or serializer fallback. Create a
ValueConverter instance, then use the strict invariant defaults or pass a ConversionContext that names every relaxed
policy.
Supported targets include booleans, characters, strings, signed and unsigned integral values, floating-point values,
decimal, GUID, DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeSpan, enums and flags, arrays, common generic
collections, dictionaries, KeyValuePair<TKey,TValue>, and DictionaryEntry.
IValueConverter converter = new ValueConverter();
ConversionResult<int> strict = converter.Convert<int>("42");
ConversionResult<byte> saturated = converter.Convert<byte>(300, new ConversionContext(
CultureInfo.InvariantCulture,
overflow: OverflowPolicy.Saturate));
Contract
- Strict defaults use invariant culture, reject overflow and fractional loss, disable numeric booleans, and accept only round-trip temporal text.
- Null succeeds only for nullable targets unless
NullPolicy.UseDefaultis selected. - Enum names are matched ordinally without regard to case. Numeric enum values still pass the selected numeric overflow and loss policies.
- Valid flags combinations may contain only bits present in declared enum members.
DateTimetext accepts UTC or unspecified round-trip values. Local values and offset-bearingDateTimetext are rejected; useDateTimeOffsetwhen an offset matters.- Collection conversion is recursive and stops at the first failed item. Strings are never treated as arbitrary enumerables.
- The converter is stateless and safe for concurrent calls.
- Failures use stable safe error codes; invalid API arguments still throw.
- No serializer fallback exists. Object/JSON conversion is intentionally outside this package.
This package is releasable alpha software. Its reviewed public surface is enforced by package validation and repository tests.
Resource bounds and extensibility
Each conversion has an explicit maximum depth and collection-item budget. Nested failures include a path such as
$[2].value. Custom strategies are immutable, explicitly ordered, and receive a bounded continuation rather than
converter internals.
Trimming and NativeAOT
The general conversion APIs use runtime type inspection and reflective collection construction. They are therefore
marked
with RequiresUnreferencedCode, and Pocok.Conversion does not claim general trimming or NativeAOT compatibility.
Consumers publishing trimmed applications receive one explicit warning at the conversion call site rather than linker
warnings leaking from internal implementation details.
The Conversion.Trimmed fixture deliberately suppresses that warning for one known array-conversion path and then
executes
the published output. It is a narrow regression smoke test, not a guarantee for arbitrary runtime-selected types,
dictionaries, custom collections, or custom strategies. Do not suppress the warning in production without testing the
complete published application graph.
| 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. |
-
net10.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pocok.Conversion:
| Package | Downloads |
|---|---|
|
Pocok.Scripting
Engine-neutral bounded script execution contracts, registry, imports, and structured diagnostics. |
|
|
Pocok.Signals
Product-neutral quality-aware live-value contracts and shared subscription runtime. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.2.0-alpha.7 | 91 | 7/20/2026 |
| 0.2.0-alpha.6 | 58 | 7/20/2026 |
| 0.2.0-alpha.5 | 53 | 7/18/2026 |
| 0.2.0-alpha.1 | 43 | 7/15/2026 |