Table of Contents

Namespace Trellis.Primitives

Classes

Age

Age value object with validation for ages 0-150.

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.

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.

Money

Represents a monetary amount with a currency code. Provides type-safe arithmetic operations that prevent mixing different currencies.

MoneyJsonConverter

JSON converter for Money value objects. Serializes Money as {"amount": 99.99, "currency": "USD"}.

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.