Skip to content

Value Objects

Preview

Source-generated scalar and complex value objects for .NET.

c-sharp csharp ddd domain-driven-design dotnet dto entity-framework immutable json roslyn scalar serialization single-case-union source-generator validation value-object value-objects zodsharp

Overview

F#-style single-case types for C#. Mark a partial struct or class with [Scalar] or [ValueObject] and an incremental source generator produces Create/Hydrate factories with normalization and validation, equality, comparison, implicit conversions, JSON converters, and contextual creation. Value objects serialize as their underlying value, map cleanly onto Entity Framework JSON columns, and can be validated with Purview.ZodSharp schemas.

From the repository: Source-generated scalar and complex value objects for .NET - F#-style single-case types with Create/Hydrate factories, normalization, validation, equality, JSON serialization, Entity Framework integration, and ZodSharp validation.

Packages

1 package

Purview.ValueObjectsInstall ↓1.0.0-prerelease.3

Install

.NET CLI
dotnet add package Purview.ValueObjects