Table of Contents

Namespace Trellis.Primitives

Classes

Age

Age value object with validation for ages 0-150.

CompositeValueObjectJsonConverter<T>

Convention-based JsonConverter<T> for composite value objects.

CountryCode

ISO 3166-1 alpha-2 country code value object.

CurrencyCode

Represents an ISO 4217 currency code as a value object.

EmailAddress

Represents an email address value object with RFC 5322-compliant validation. Ensures that email addresses are syntactically valid and prevents invalid email data in the domain model.

GeoBoundingBox

One non-wrapping latitude/longitude rectangle used as a conservative geographic query prefilter.

GeoBounds

A validated spherical-radius search area represented by one or two conservative non-wrapping boxes.

GeoCoordinate

A geographic latitude and longitude in decimal degrees.

Hostname

RFC 1123 compliant hostname value object.

IpAddress

Represents an IP address (IPv4 or IPv6) as a value object.

LanguageCode

ISO 639-1 language code value object.

MonetaryAmount

A non-negative monetary amount without currency — for single-currency systems.

Use MonetaryAmount when your bounded context operates in a single currency (e.g., all USD). The currency is a system-wide policy, not per-row data. Maps to a single decimal(18,2) column in EF Core via ApplyTrellisConventions.

For multi-currency systems where each value carries its own currency code, use Money instead.

Money

Represents a structured monetary value object composed of an amount and currency code. Provides type-safe arithmetic operations that prevent mixing different currencies.

Percentage

Represents a percentage value object (value between 0 and 100 inclusive). Ensures that percentage values are within the valid range for percentage calculations.

PhoneNumber

Represents a phone number value object with E.164 format validation. Ensures that phone numbers follow international standards for telephony.

Slug

URL-safe slug value object (lowercase letters, digits, single hyphens).

Url

Represents a URL value object with format validation. Ensures that URLs are valid and well-formed for web and API scenarios.

WeeklyPeriod

An immutable, recurring local-clock interval starting on a day of the week.

WeeklySchedule

Immutable weekly availability in an IANA time zone, evaluated against local wall-clock time.