AdCodicem.ValueObjects 0.3.0

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

AdCodicem.ValueObjects

An answer to primitive obsession for .NET 10 and later: single-value DDD value objects, generated at compile time, with no reflection and no allocation on the paths that matter. This is the package to install: it brings the source generator, its analyzers and code fixes, and the abstractions the generated code implements.

dotnet add package AdCodicem.ValueObjects

A readonly partial struct marked [ValueObject<T>] gets its whole implementation: construction that normalizes, then validates, then assigns, so that an instance is valid by construction; equality, comparison, parsing and formatting; and a JSON converter and a type converter, through which it crosses every boundary as its underlying type.

using AdCodicem.ValueObjects;
using AdCodicem.ValueObjects.Annotations;

namespace Shop;

[ValueObject<string>(MinLength = 3, MaxLength = 12)]
public readonly partial struct Sku;

public static class Catalogue
{
    public static Sku Parse(string text) => Sku.Create(text);

    public static bool TryRead(string text, out Sku sku) => Sku.TryCreate(text, out sku);
}

Its rules are declared once, and reach JSON, EF Core, model binding, the OpenAPI document and every other integration through the packages of the same name.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AdCodicem.ValueObjects:

Package Downloads
AdCodicem.ValueObjects.Identifiers

Stripe-style public entity identifiers as value objects. Annotate a readonly partial struct with [EntityId("acc")] and get a prefixed, fixed-width, index-friendly identifier with a check character, generated with no reflection and no allocation beyond the value itself.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 137 10/29/2026
0.3.0-preview.425 75 10/27/2026
0.3.0-preview.322 145 10/19/2026
0.3.0-preview.283 95 10/12/2026
0.3.0-preview.248 78 10/5/2026
0.3.0-preview.205 75 10/4/2026
0.3.0-preview.197 82 10/3/2026
0.2.2-preview.0.172 80 10/3/2026
0.2.2-preview.0.144 64 10/2/2026
0.2.2-preview.0.143 72 10/2/2026
0.2.2-preview.0.138 79 10/2/2026
0.2.2-preview.0.137 75 10/2/2026
0.2.2-preview.0.136 72 10/2/2026
0.2.2-preview.0.135 69 10/1/2026
0.2.2-preview.0.100 64 10/1/2026
0.2.2-preview.0.2 67 9/30/2026
0.2.2-preview.0.1 79 9/30/2026
0.2.1 277 9/30/2026
0.2.1-preview.0.12 74 9/30/2026
0.2.1-preview.0.11 71 9/30/2026
Loading failed