JorgeCostaMacia.DDD.ValueObject
11.2.4
Prefix Reserved
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
<PackageReference Include="JorgeCostaMacia.DDD.ValueObject" Version="11.2.4" />
<PackageVersion Include="JorgeCostaMacia.DDD.ValueObject" Version="11.2.4" />
<PackageReference Include="JorgeCostaMacia.DDD.ValueObject" />
paket add JorgeCostaMacia.DDD.ValueObject --version 11.2.4
#r "nuget: JorgeCostaMacia.DDD.ValueObject, 11.2.4"
#:package JorgeCostaMacia.DDD.ValueObject@11.2.4
#addin nuget:?package=JorgeCostaMacia.DDD.ValueObject&version=11.2.4
#tool nuget:?package=JorgeCostaMacia.DDD.ValueObject&version=11.2.4
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.
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
Ordersmodule 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.
- Repository: github.com/JorgeCostaMacia/ddd-dotnet
- Issues & requests: open an issue
- Contributing: CONTRIBUTING.md
- Security: report a vulnerability
Author: Jorge Costa Maciá
| 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. net11.0 is compatible. |
-
net10.0
- FluentValidation (>= 12.2.0)
- JorgeCostaMacia.DDD.Exception (>= 11.2.4)
-
net11.0
- FluentValidation (>= 12.2.0)
- JorgeCostaMacia.DDD.Exception (>= 11.2.4)
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 |