BetterPractice.Snowed.AspNetCore 0.1.0

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

Snowed for .NET

C# implementation of the Snowed binary encoding: a self-describing, streaming-friendly wire format with native Binary, UUID, DateTime, and Decimal types. The wire format is defined by the specification; this package is one of several conforming implementations.

Package Contents
BetterPractice.Snowed Serializer, document object model, HttpClient extensions
BetterPractice.Snowed.AspNetCore ASP.NET Core MVC input and output formatters
dotnet add package BetterPractice.Snowed
dotnet add package BetterPractice.Snowed.AspNetCore   # servers only

Targets net8.0 and net10.0. No dependencies beyond the framework.

Serializing objects

using Snowed;

public sealed class Patient
{
    [SnowedPropertyName("patient_id")]
    public required Guid PatientId { get; init; }

    [SnowedPropertyName("created_at")]
    public required DateTimeOffset CreatedAt { get; init; }

    [SnowedPropertyName("data")]
    public required byte[] Data { get; init; }      // encoded as native Binary, no base64

    [SnowedIgnore]
    public string? Transient { get; set; }
}

byte[] bytes = SnowedSerializer.Serialize(patient);
Patient? back = SnowedSerializer.Deserialize<Patient>(bytes);

Stream overloads exist for both directions, including SerializeAsync and DeserializeAsync, so large payloads never need to be buffered in full.

SnowedSerializerOptions controls naming policy, converters, and how unknown fields and duplicate keys are handled. Custom types implement SnowedConverter<T>.

Document model

When the shape is not known ahead of time, work with the value tree directly:

SnowedValue value = SnowedSerializer.DeserializeValue(bytes);
if (value is SnowedObject obj && obj["patient_id"] is SnowedUuid id)
{
    // ...
}

byte[] encoded = SnowedSerializer.Encode(obj);

HttpClient

The Snowed.Http namespace adds Snowed equivalents of the JSON HttpClient helpers. Requests are sent with content type application/snowed.

using Snowed.Http;

var created = await client.PostAsSnowedAsync<CreateRequest, CreateResponse>("/patients", request);
var patient = await client.GetFromSnowedAsync<Patient>($"/patients/{id}");

PutAsSnowedAsync, PatchAsSnowedAsync, and ReadFromSnowedAsync on HttpContent are also provided.

ASP.NET Core

builder.Services.AddControllers().AddSnowed();

Registers input and output formatters for application/snowed. Controllers then bind [FromBody] parameters and return results in Snowed with no further changes. Pass a SnowedSerializerOptions to AddSnowed to customize serialization server-wide.

Versioning

Versions below 1.0 signal that the library API may still change. The wire format is governed by the specification, and every implementation in the repository is validated against the shared conformance vectors.

License

MIT. See LICENSE.

Product 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 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.

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.0 45 9/4/2026