JorgeCostaMacia.DDD.ValueObject 11.2.4

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package JorgeCostaMacia.DDD.ValueObject --version 11.2.4
                    
NuGet\Install-Package JorgeCostaMacia.DDD.ValueObject -Version 11.2.4
                    
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="JorgeCostaMacia.DDD.ValueObject" Version="11.2.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JorgeCostaMacia.DDD.ValueObject" Version="11.2.4" />
                    
Directory.Packages.props
<PackageReference Include="JorgeCostaMacia.DDD.ValueObject" />
                    
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 JorgeCostaMacia.DDD.ValueObject --version 11.2.4
                    
#r "nuget: JorgeCostaMacia.DDD.ValueObject, 11.2.4"
                    
#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 JorgeCostaMacia.DDD.ValueObject@11.2.4
                    
#: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=JorgeCostaMacia.DDD.ValueObject&version=11.2.4
                    
Install as a Cake Addin
#tool nuget:?package=JorgeCostaMacia.DDD.ValueObject&version=11.2.4
                    
Install as a Cake Tool

JorgeCostaMacia.DDD.ValueObject

Immutable, typed value objects for the primitives (numbers, string, bool, Guid, DateTime, UTC DateTime, DateOnly, TimeOnly, bytes), for semantic types (email, IPv4, JSON, URI) and for paging and ordering. Each one has the same creation surface, a FluentValidation validator and a typed validation exception.

NuGet Downloads Build License


Install

dotnet add package JorgeCostaMacia.DDD.ValueObject

Usage

using JorgeCostaMacia.DDD.ValueObject.Domain;

EmailValueObject email = EmailValueObject.Create("user@host.com");   // validated: nothing invalid gets out of Create
EmailValueObject draft = EmailValueObject.From("  user@host.com ");  // trimmed, not validated
EmailValueObject? none = EmailValueObject.CreateOrNull(null);         // the field did not come: null in, null out
string raw = email;                                                  // the primitive, through an implicit operator

A value object of your own derives from the base of its primitive and declares the four factories (From, FromOrNull, Create, CreateOrNull) and its own validator.

Documentation

  • Value objects: the four factories, Convert, your own value objects, and what each base checks.
  • Validation: the validator of a value object, and every failure in one exception.
  • samples/Shop: an application with an Orders module that uses every package together.

Requirements

The .NET 10 or .NET 11 SDK.

Depends on JorgeCostaMacia.DDD.Exception and FluentValidation.

About

JorgeCostaMacia.DDD.ValueObject is part of ddd-dotnet: DDD building blocks for .NET, with value objects and their FluentValidation validators, aggregates, entities, domain events and the domain exception hierarchy, each package scoped to a single concern.

Author: Jorge Costa Maciá

Product 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.  net11.0 is compatible. 
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
11.2.5-dev.12 39 12/3/2026
11.2.5-dev.11 46 12/3/2026
11.2.5-dev.10 45 12/3/2026
11.2.5-dev.9 46 12/3/2026
11.2.4 51 12/2/2026
11.2.3 42 12/2/2026
11.2.2 48 12/2/2026
11.2.1 60 12/2/2026
11.2.0 50 12/2/2026
11.1.0 48 12/2/2026
11.0.2 545 11/9/2026
11.0.1 103 11/9/2026
11.0.0 119 11/8/2026