class
AgeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class AgeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an age domain primitive. Equivalent to: `[NumericPrimitive<int>] [PrimitiveRange(0, 150)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
BirthDateAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class BirthDateAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a birth date domain primitive. Equivalent to: `[DatePrimitive(Kind = DateOnly, PastOnly = true)]`.
class
BusinessDateAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class BusinessDateAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a business date domain primitive.
class
CountryCodeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class CountryCodeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an ISO 3166-1 alpha-2 country code (e.g., "US", "DE"). Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Length(2, 2)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
CurrencyCodeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class CurrencyCodeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an ISO 4217 currency code (e.g., "USD", "EUR"). Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Length(3, 3)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
DatePrimitiveAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DatePrimitiveAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a date- or time-backed domain primitive.
Miembros (3)
propertyFutureOnly
public bool FutureOnly { get; init; }
Gets a value indicating whether only future dates or times are allowed (after current UTC time).
propertyKind
public DatePrimitiveKind Kind { get; init; }
Gets the backing temporal type. Default: `DatePrimitiveKind.DateOnly`.
propertyPastOnly
public bool PastOnly { get; init; }
Gets a value indicating whether only past dates or times are allowed (before current UTC time).
enum
DatePrimitiveKind
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic enum DatePrimitiveKind
Specifies the backing temporal type for a date primitive.
Miembros (4)
fieldDateOnly
DateOnly
Specifies backing by `System.DateOnly` for dates without time components.
fieldDateTime
DateTime
Specifies backing by `System.DateTime` when both date and time are needed.
fieldDateTimeOffset
DateTimeOffset
Specifies backing by `System.DateTimeOffset` when timezone-aware timestamps are needed.
fieldTimeOnly
TimeOnly
Specifies backing by `System.TimeOnly` for time-of-day without a date component.
class
DateRangeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DateRangeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a date range domain primitive. Architectural Guidance: In Domain-Driven Design, when modeling a compound interval with both start and end timestamps and cross-property validation (`Start <= End`), prefer creating a compound `[ValueObject]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
DiscountAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DiscountAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a discount domain primitive. Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, 100)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum discount percentage. Default: 100.
propertyMin
public double Min { get; init; }
Gets the minimum discount percentage. Default: 0.
class
DistanceAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DistanceAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a distance domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(0, double.MaxValue)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum allowed distance in meters. Default: `double.MaxValue`.
propertyMin
public double Min { get; init; }
Gets the minimum allowed distance in meters. Default: 0.
class
DomainPrimitiveValidationException
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DomainPrimitiveValidationException : ArgumentException
Hereda de: ArgumentException
Represents the exception thrown when a domain primitive cannot be created due to invalid input.
Miembros (5)
constructorDomainPrimitiveValidationException
public DomainPrimitiveValidationException(PrimitiveError error)
Initializes a new instance of the `DomainPrimitiveValidationException` class with a structured validation error.
- error: PrimitiveError
- The structured validation error containing the error code and message.
constructorDomainPrimitiveValidationException
public DomainPrimitiveValidationException(PrimitiveError error, Exception? innerException)
Initializes a new instance of the `DomainPrimitiveValidationException` class with a structured validation error and an inner exception.
- error: PrimitiveError
- The structured validation error containing the error code and message.
- innerException: Exception?
- The exception that is the cause of the current exception.
constructorDomainPrimitiveValidationException
public DomainPrimitiveValidationException(PrimitiveError error, Exception? innerException, string paramName)
Initializes a new instance of the `DomainPrimitiveValidationException` class with a structured validation error, an inner exception, and a parameter name.
- error: PrimitiveError
- The structured validation error containing the error code and message.
- innerException: Exception?
- The exception that is the cause of the current exception.
- paramName: string
- The name of the parameter that caused the exception.
constructorDomainPrimitiveValidationException
public DomainPrimitiveValidationException(PrimitiveError error, string paramName)
Initializes a new instance of the `DomainPrimitiveValidationException` class with a structured validation error and a parameter name.
- error: PrimitiveError
- The structured validation error containing the error code and message.
- paramName: string
- The name of the parameter that caused the exception.
propertyError
public PrimitiveError Error { get; }
Gets the structured validation error that caused the exception.
class
DomainPrimitivesDefaultsAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class DomainPrimitivesDefaultsAttribute : Attribute
Hereda de: Attribute
Specifies global default policies for domain primitives generated in this assembly.
Miembros (4)
propertyExceptionType
public Type? ExceptionType { get; set; }
Gets or sets a custom exception type to throw on validation failures in `Create()`. The exception type must inherit from `Exception` and provide a constructor accepting a string message. If not specified, `DomainPrimitiveValidationException` is thrown.
propertyMaxLength
public int MaxLength { get; set; }
Gets or sets a default maximum length for string primitives when no explicit length is specified. Default is 4096 (security limit).
propertyNotEmpty
public bool NotEmpty { get; set; }
Gets or sets a value indicating whether string primitives should automatically enforce not-empty validation by default.
propertyTrim
public bool Trim { get; set; }
Gets or sets a value indicating whether string primitives should automatically trim whitespace by default.
class
EmailAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class EmailAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an email address domain primitive. Equivalent to: `[StringPrimitive] [Trim] [LowerCase] [MaxLength(254)] [Regex(RFC5322)]`.
class
ExactLengthAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class ExactLengthAttribute : Attribute
Hereda de: Attribute
Specifies that a string domain primitive must have exactly `n` characters.
Miembros (4)
constructorExactLengthAttribute
public ExactLengthAttribute(int length)
Initializes a new instance of the `ExactLengthAttribute` class with the specified exact length.
- length: int
- The exact number of characters the value must have.
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the constraint is violated. Defaults to `"LENGTH"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message. If null, the generator produces a message with the expected length and actual length.
propertyLength
public int Length { get; }
Gets the required exact length.
class
ExpirationDateAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class ExpirationDateAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an expiration date domain primitive. Equivalent to: `[DatePrimitive(Kind = DateOnly, FutureOnly = true)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
FiscalYearAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class FiscalYearAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a fiscal year domain primitive.
class
HeightAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class HeightAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a height domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(0, 300)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum allowed height in cm. Default: 300.
propertyMin
public double Min { get; init; }
Gets the minimum allowed height in cm. Default: 0.
class
HexColorAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class HexColorAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a CSS hex color domain primitive (e.g., "#FF5733"). Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Regex(hex-color)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
IBANAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class IBANAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an International Bank Account Number (IBAN) domain primitive. Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Regex(iban-pattern)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
interface
IDomainPrimitive<TSelf>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic interface IDomainPrimitive<TSelf> where TSelf : IDomainPrimitive<TSelf>
Defines the contract for all domain primitive types. Enables generic constraints and discovery without introducing runtime overhead.
Miembros (2)
propertyIsDefault
bool IsDefault { get; }
Gets a value indicating whether this instance was created via `default` rather than a factory method.
propertyPrimitiveName
static abstract string PrimitiveName { get; }
Gets the name of this domain primitive type, used in diagnostics, error messages, and observability.
interface
IDomainPrimitive<TSelf, TValue>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic interface IDomainPrimitive<TSelf, TValue> : IDomainPrimitive<TSelf> where TSelf : IDomainPrimitive<TSelf, TValue> where TValue : notnull
Implementa: IDomainPrimitive<TSelf>
Defines a domain primitive wrapping a single backing value of type `TValue`.
Miembros (3)
methodCreate
static abstract TSelf Create(TValue value)
Creates a new, validated instance from the specified raw value, applying normalization before validation.
- value: TValue
- The raw value to normalize and validate.
Retorna: A valid, normalized domain primitive instance.
methodTryCreate
static abstract bool TryCreate(TValue value, out TSelf result, out global::EricksonLopez.DomainPrimitives.Validation.PrimitiveError validationError)
Attempts to create a new, validated instance from the specified raw value without throwing on failure.
- value: TValue
- The raw value to normalize and validate.
- result: out TSelf
- When this method returns `true`, contains the valid primitive instance; otherwise, the default value for `TSelf`.
- validationError: out global::EricksonLopez.DomainPrimitives.Validation.PrimitiveError
- When this method returns `false`, contains the first validation error that occurred.
Retorna: `true` if the instance was created successfully; otherwise, `false`.
propertyValue
TValue Value { get; }
Gets the validated, normalized underlying value wrapped by this domain primitive.
interface
IGuidStrongId<TSelf>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic interface IGuidStrongId<TSelf> : IStrongId<TSelf, Guid> where TSelf : struct, IGuidStrongId<TSelf>
Implementa: IStrongId<TSelf, Guid>
Defines the contract for strongly-typed identifiers backed by a `Guid` that support parameterless generation of unique values via `Create()`.
Miembros (1)
methodCreate
new static abstract TSelf Create()
Creates a new, unique identifier using a newly generated `Guid`.
Retorna: A new strong ID wrapping a freshly generated `Guid`.
interface
INormalizer<T>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic interface INormalizer<T>
Defines a contract for a custom normalization strategy.
Miembros (1)
methodNormalize
static abstract T Normalize(T value)
Normalizes the specified input value.
- value: T
- The value to normalize.
Retorna: The normalized value resulting from the transformation.
class
IPAddressAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class IPAddressAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an IPv4 or IPv6 address domain primitive. Equivalent to: `[StringPrimitive] [Trim] [Regex(ip-pattern)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
ISBNAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class ISBNAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an International Standard Book Number (ISBN) domain primitive. Equivalent to: `[StringPrimitive] [Trim] [Regex(isbn-pattern)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
interface
IStrongId<TSelf, TValue>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic interface IStrongId<TSelf, TValue> : IDomainPrimitive<TSelf, TValue> where TSelf : IStrongId<TSelf, TValue> where TValue : notnull
Implementa: IDomainPrimitive<TSelf, TValue>
Defines the contract for strongly-typed identifiers.
Miembros (2)
methodCreate
static abstract TSelf Create()
Creates a new, unique identifier.
Retorna: A new strong ID wrapping a freshly generated value.
propertyEmpty
static abstract TSelf Empty { get; }
Gets the empty or uninitialized sentinel value for this identifier type.
class
LanguageCodeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class LanguageCodeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is an ISO 639-1 language code (e.g., "en", "es"). Equivalent to: `[StringPrimitive] [Trim] [LowerCase] [Length(2, 2)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
LatitudeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class LatitudeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a latitude domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(-90, 90)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
LengthAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class LengthAttribute : Attribute
Hereda de: Attribute
Specifies both minimum and maximum length for a string domain primitive.
Miembros (5)
constructorLengthAttribute
public LengthAttribute(int min, int max)
Initializes a new instance of the `LengthAttribute` class with the specified minimum and maximum lengths.
- min: int
- The minimum allowed length (inclusive).
- max: int
- The maximum allowed length (inclusive).
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the length constraint is violated. Defaults to `"LENGTH"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the length constraint is violated.
propertyMax
public int Max { get; }
Gets the maximum allowed length (inclusive).
propertyMin
public int Min { get; }
Gets the minimum allowed length (inclusive).
class
LongitudeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class LongitudeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a longitude domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(-180, 180)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
LowerCaseAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class LowerCaseAttribute : Attribute
Hereda de: Attribute
Specifies that a string domain primitive should be converted to lower case before validation.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
MacAddressAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class MacAddressAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a MAC address domain primitive. Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Regex(mac-pattern)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
MaxLengthAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class MaxLengthAttribute : Attribute
Hereda de: Attribute
Specifies the maximum length for a string domain primitive.
Miembros (4)
constructorMaxLengthAttribute
public MaxLengthAttribute(int length)
Initializes a new instance of the `MaxLengthAttribute` class with the specified maximum length.
- length: int
- The maximum number of characters the value may have (inclusive).
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the constraint is violated. Defaults to `"LENGTH"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the value exceeds the maximum length.
propertyLength
public int Length { get; }
Gets the maximum allowed length (inclusive).
class
MinLengthAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class MinLengthAttribute : Attribute
Hereda de: Attribute
Specifies the minimum length for a string domain primitive.
Miembros (4)
constructorMinLengthAttribute
public MinLengthAttribute(int length)
Initializes a new instance of the `MinLengthAttribute` class with the specified minimum length.
- length: int
- The minimum number of characters the value must have (inclusive).
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the constraint is violated. Defaults to `"LENGTH"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the value is shorter than the minimum length.
propertyLength
public int Length { get; }
Gets the minimum required length (inclusive).
class
MoneyAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class MoneyAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a monetary value domain primitive. Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, max)]` with addition, subtraction, and scalar multiplication/division operators.
Miembros (6)
constructorMoneyAttribute
public MoneyAttribute()
Initializes a new instance of the `MoneyAttribute` class with default USD currency and no explicit range constraints.
constructorMoneyAttribute
public MoneyAttribute(string currency)
Initializes a new instance of the `MoneyAttribute` class with the specified currency code.
- currency: string
- The ISO 4217 currency code (e.g., `"USD"`, `"EUR"`).
constructorMoneyAttribute
public MoneyAttribute(string currency, double min, double max = double.MaxValue)
Initializes a new instance of the `MoneyAttribute` class with the specified currency code and value range.
- currency: string
- The ISO 4217 currency code (e.g., `"USD"`, `"EUR"`).
- min: double
- The minimum allowed monetary value (inclusive). Use 0 for non-negative amounts.
- max: double
- The maximum allowed monetary value (inclusive). Defaults to `double.MaxValue`.
propertyCurrency
public string Currency { get; init; }
Gets the ISO 4217 currency code. Default: "USD".
propertyMax
public double Max { get; init; }
Gets the maximum allowed value. Default: `double.MaxValue`.
propertyMin
public double Min { get; init; }
Gets the minimum allowed value. Default: 0.
class
MonthAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class MonthAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a month domain primitive.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
NormalizeAttribute<TNormalizer>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class NormalizeAttribute<TNormalizer> : Attribute
Hereda de: Attribute
Specifies a custom normalization strategy to apply to a domain primitive.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
NormalizeWhitespaceAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class NormalizeWhitespaceAttribute : Attribute
Hereda de: Attribute
Specifies that internal whitespace should be normalized by collapsing consecutive whitespace characters into a single space.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
NotEmptyAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class NotEmptyAttribute : Attribute
Hereda de: Attribute
Specifies that a string domain primitive must not be empty or whitespace-only.
Miembros (2)
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the value is empty or whitespace-only. Defaults to `"EMPTY"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the value is empty or whitespace-only.
enum
NumericOperations
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic enum NumericOperations
Defines the allowed arithmetic operations for a numeric domain primitive.
Miembros (9)
fieldAddition
Addition = 1<<0
Allows addition.
fieldAdditive
Additive = Addition|Subtraction|Negation
Allows addition and subtraction.
fieldAll
All = Additive|Multiplicative
Allows all arithmetic operations.
fieldMultiplicative
Multiplicative = ScalarMultiplication|ScalarDivision
Allows scalar multiplication and division.
fieldNegation
Negation = 1<<4
Allows unary negation.
fieldNone
None = 0
No arithmetic operations are allowed.
fieldScalarDivision
ScalarDivision = 1<<3
Allows scalar division.
fieldScalarMultiplication
ScalarMultiplication = 1<<2
Allows scalar multiplication.
fieldSubtraction
Subtraction = 1<<1
Allows subtraction.
class
NumericPrimitiveAttribute<TValue>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class NumericPrimitiveAttribute<TValue> : Attribute where TValue : struct, INumber<TValue>
Hereda de: Attribute
Specifies that a struct is a numeric-backed domain primitive.
class
PasswordHashAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class PasswordHashAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a password hash domain primitive. Equivalent to: `[StringPrimitive] [NotEmpty]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
PercentageAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class PercentageAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a percentage value domain primitive (0-100 scale). Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, 100)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum allowed value. Default: 100.
propertyMin
public double Min { get; init; }
Gets the minimum allowed value. Default: 0.
class
PhoneAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class PhoneAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a phone number domain primitive. Equivalent to: `[StringPrimitive] [Trim] [Regex(E.164)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
PriceAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class PriceAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a price domain primitive. Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, double.MaxValue)]` with addition and subtraction operators.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum price. Default: `double.MaxValue`.
propertyMin
public double Min { get; init; }
Gets the minimum price. Default: 0.
class
PrimitiveCollectionExtensions
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic static class PrimitiveCollectionExtensions
Provides extension methods for converting collections of raw values into collections of domain primitives.
Miembros (5)
methodToDomainPrimitiveArray<TPrimitive, TValue>
public static TPrimitive[] ToDomainPrimitiveArray<TPrimitive, TValue>(this IEnumerable<TValue> values) where TPrimitive : struct, IDomainPrimitive<TPrimitive, TValue> where TValue : notnull
Creates an array of domain primitives by creating each element from the corresponding raw value.
- values: this IEnumerable<TValue>
- The sequence of raw values to convert.
Retorna: A new array containing one validated domain primitive for each element in `values`. Never returns `null` but may be empty if the source sequence is empty.
methodToDomainPrimitiveArray<TPrimitive, TValue>
public static TPrimitive[] ToDomainPrimitiveArray<TPrimitive, TValue>(this IEnumerable<TValue> values, Func<TValue, TPrimitive> factory) where TPrimitive : struct where TValue : notnull
Creates an array of domain primitives by invoking `factory` for each raw value.
- values: this IEnumerable<TValue>
- The sequence of raw values to convert.
- factory: Func<TValue, TPrimitive>
- The factory delegate used to construct each domain primitive.
Retorna: A new array containing one domain primitive for each element in `values`.
methodToDomainPrimitiveArray<TPrimitive, TValue>
public static TPrimitive[] ToDomainPrimitiveArray<TPrimitive, TValue>(this System.ReadOnlySpan<TValue> values) where TPrimitive : struct, IDomainPrimitive<TPrimitive, TValue> where TValue : notnull
Creates an array of domain primitives by creating each element from the corresponding raw value in a `System.ReadOnlySpan<T>`.
- values: this System.ReadOnlySpan<TValue>
- The span of raw values to convert.
Retorna: A new array containing one validated domain primitive for each element in `values`. Never returns `null` but may be empty if `values` is empty.
methodToDomainPrimitiveList<TPrimitive, TValue>
public static List<TPrimitive> ToDomainPrimitiveList<TPrimitive, TValue>(this IEnumerable<TValue> values) where TPrimitive : struct, IDomainPrimitive<TPrimitive, TValue> where TValue : notnull
Creates a `List<T>` of domain primitives by creating each element from the corresponding raw value.
- values: this IEnumerable<TValue>
- The sequence of raw values to convert.
Retorna: A new `List<T>` containing one validated domain primitive for each element in `values`. Never returns `null` but may be empty if the source sequence is empty.
methodToDomainPrimitiveList<TPrimitive, TValue>
public static List<TPrimitive> ToDomainPrimitiveList<TPrimitive, TValue>(this IEnumerable<TValue> values, Func<TValue, TPrimitive> factory) where TPrimitive : struct where TValue : notnull
Creates a `List<T>` of domain primitives by invoking `factory` for each raw value.
- values: this IEnumerable<TValue>
- The sequence of raw values to convert.
- factory: Func<TValue, TPrimitive>
- The factory delegate used to construct each domain primitive.
Retorna: A new `List<T>` containing one domain primitive for each element in `values`.
class
PrimitiveRangeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class PrimitiveRangeAttribute : Attribute
Hereda de: Attribute
Specifies range validation constraints on numeric domain primitives. Use this instead of `RangeAttribute` when your project also references `System.ComponentModel.DataAnnotations` to avoid ambiguous attribute errors.
Miembros (10)
constructorPrimitiveRangeAttribute
public PrimitiveRangeAttribute(double min, double max)
Initializes a new instance of the `PrimitiveRangeAttribute` class with the specified double bounds.
- min: double
- The minimum allowed value (inclusive by default).
- max: double
- The maximum allowed value (inclusive by default).
constructorPrimitiveRangeAttribute
public PrimitiveRangeAttribute(string stringMin, string stringMax)
Initializes a new instance of the `PrimitiveRangeAttribute` class with the specified string bounds for exact precision.
- stringMin: string
- The minimum bound expressed as a parseable string. Use for exact `decimal` precision.
- stringMax: string
- The maximum bound expressed as a parseable string. Use for exact `decimal` precision.
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the range constraint is violated. Defaults to `"RANGE"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the value is outside the allowed range.
propertyMax
public double Max { get; }
Gets the maximum allowed value when specified as a `double`. Zero when the string overload is used.
propertyMaxExclusive
public bool MaxExclusive { get; init; }
Gets or sets a value indicating whether the maximum bound is exclusive. Default: `false` (inclusive).
propertyMin
public double Min { get; }
Gets the minimum allowed value when specified as a `double`. Zero when the string overload is used.
propertyMinExclusive
public bool MinExclusive { get; init; }
Gets or sets a value indicating whether the minimum bound is exclusive. Default: `false` (inclusive).
propertyStringMax
public string? StringMax { get; }
Gets the maximum bound as a string when specified via the string overload; otherwise `null`.
propertyStringMin
public string? StringMin { get; }
Gets the minimum bound as a string when specified via the string overload; otherwise `null`.
class
QuantityAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class QuantityAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a quantity domain primitive. Equivalent to: `[NumericPrimitive<int>] [PrimitiveRange(0, int.MaxValue)]`.
Miembros (2)
propertyMax
public int Max { get; init; }
Gets the maximum quantity (inclusive). Default: `int.MaxValue`.
propertyMin
public int Min { get; init; }
Gets the minimum quantity (inclusive). Default: 0.
class
QuarterAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class QuarterAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a quarter domain primitive.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
RatingAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class RatingAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a rating domain primitive. Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, 5)]`.
Miembros (3)
propertyMax
public double Max { get; init; }
Gets the maximum rating. Default: 5.
propertyMin
public double Min { get; init; }
Gets the minimum rating. Default: 0.
propertyScale
public int Scale { get; init; }
Gets the number of decimal places allowed. Default: 1 (e.g., 4.5). Use 0 for whole-number-only ratings.
class
RegexAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class RegexAttribute : Attribute
Hereda de: Attribute
Specifies a regular expression pattern that the string value must match.
Miembros (4)
constructorRegexAttribute
public RegexAttribute(string pattern)
Initializes a new instance of the `RegexAttribute` class with the specified regular expression pattern.
- pattern: string
- The regular expression pattern the value must match.
propertyErrorCode
public string? ErrorCode { get; set; }
Gets or sets the error code emitted when the pattern is not matched. Defaults to `"FORMAT"`.
propertyErrorMessage
public string? ErrorMessage { get; set; }
Gets or sets the error message emitted when the value does not match the pattern.
propertyPattern
public string Pattern { get; }
Gets the regular expression pattern the value must match.
class
ScoreAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class ScoreAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a score domain primitive. Equivalent to: `[NumericPrimitive<int>] [PrimitiveRange(0, 100)]`.
Miembros (2)
propertyMax
public int Max { get; init; }
Gets the maximum score (inclusive). Default: 100.
propertyMin
public int Min { get; init; }
Gets the minimum score (inclusive). Default: 0.
class
SlugAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class SlugAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a URL slug domain primitive. Equivalent to: `[StringPrimitive] [Trim] [LowerCase] [Regex(slug-pattern)]`.
class
SmartEnumAttribute<TValue>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class SmartEnumAttribute<TValue> : Attribute where TValue : notnull
Hereda de: Attribute
Specifies that a struct is a smart enum with a backing value of type `TValue`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
StringPrimitiveAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class StringPrimitiveAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a string-backed domain primitive.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
StrongIdAttribute<TValue>
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class StrongIdAttribute<TValue> : Attribute where TValue : notnull
Hereda de: Attribute
Specifies that a struct is a strongly-typed identifier wrapping `TValue`.
Miembros (1)
propertyRejectEmpty
public bool RejectEmpty { get; set; }
Gets or sets a value indicating whether empty backing values are rejected. When `true`, `Create()` throws and `TryCreate()` returns `false` for empty values (e.g., `Guid.Empty`, `0`, or `""`). Defaults to `true`.
class
TaxRateAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TaxRateAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a tax rate domain primitive. Equivalent to: `[NumericPrimitive<decimal>] [PrimitiveRange(0, 100)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum tax rate percentage. Default: 100.
propertyMin
public double Min { get; init; }
Gets the minimum tax rate percentage. Default: 0.
class
TemperatureAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TemperatureAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a temperature domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(-273.15, double.MaxValue)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum temperature. Default: `double.MaxValue`.
propertyMin
public double Min { get; init; }
Gets the minimum temperature. Default: -273.15 (absolute zero in Celsius).
class
TimeRangeAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TimeRangeAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a time range domain primitive. Architectural Guidance: In Domain-Driven Design, when modeling a compound interval with both start and end times and cross-property validation (`Start <= End`), prefer creating a compound `[ValueObject]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
TrimAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TrimAttribute : Attribute
Hereda de: Attribute
Specifies that leading and trailing whitespace should be trimmed from the string value.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
TrimEndAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TrimEndAttribute : Attribute
Hereda de: Attribute
Specifies that trailing whitespace should be trimmed from a string domain primitive before validation.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
TrimStartAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class TrimStartAttribute : Attribute
Hereda de: Attribute
Specifies that leading whitespace should be trimmed from a string domain primitive before validation.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
UpperCaseAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class UpperCaseAttribute : Attribute
Hereda de: Attribute
Specifies that a string domain primitive should be converted to upper case before validation.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
UrlAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class UrlAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a URL domain primitive. Equivalent to: `[StringPrimitive] [Trim]` with `System.Uri` validation.
Miembros (1)
propertyAllowedSchemes
public string[] AllowedSchemes { get; init; }
Gets the allowed URI schemes. Default: `["https", "http"]`.
class
UsernameAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class UsernameAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a username domain primitive. Equivalent to: `[StringPrimitive] [Trim] [Regex(alphanumeric + ._-)]`.
Miembros (2)
propertyMaxLength
public int MaxLength { get; init; }
Gets the maximum length. Default: 50.
propertyMinLength
public int MinLength { get; init; }
Gets the minimum length. Default: 3.
class
VINAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class VINAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a Vehicle Identification Number (VIN) domain primitive. Equivalent to: `[StringPrimitive] [Trim] [UpperCase] [Regex(vin-pattern)]`.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
record
ValueObject
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic abstract record class ValueObject
Base record class for complex multi-property Value Objects — types defined by their structural equality.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
ValueObjectAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class ValueObjectAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a composite value object with structural equality across all properties.
Miembros (0)
Este tipo declara 0 miembros públicos (por ejemplo, interfaz marcadora o enum/record vacío).
class
WeekAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class WeekAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a week domain primitive.
class
WeightAttribute
Ensamblado: EricksonLopez.DomainPrimitives.Abstractionspublic sealed class WeightAttribute : Attribute
Hereda de: Attribute
Specifies that a struct is a weight domain primitive. Equivalent to: `[NumericPrimitive<double>] [PrimitiveRange(0, double.MaxValue)]`.
Miembros (2)
propertyMax
public double Max { get; init; }
Gets the maximum allowed weight in kg. Default: 1000.
propertyMin
public double Min { get; init; }
Gets the minimum allowed weight in kg. Default: 0.