Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

EricksonLopez.DomainPrimitives Overview

EricksonLopez.DomainPrimitives (3.0.0 on NuGet, L0) eliminates Primitive Obsession at compile time using Roslyn incremental source generators on readonly partial record struct types (ADR-011).

  • Compile-time factory, parser, and formatter generation: Emits Create, TryCreate(..., out PrimitiveError), Parse, TryParse (IParsable<T>, ISpanParsable<T>, IUtf8SpanParsable<T>), ISpanFormattable, IUtf8SpanFormattable, and explicit conversions.
  • Zero-allocation numeric & ID hot paths: StrongIds, SmartEnums, and numeric primitives reside on the stack (0 B heap allocation). String primitives apply NFC Unicode normalization where configured.
  • Live IDE enforcement: DP0001–DP0018 (Analyzers) and DP1001–DP1005 (Generators) catch invalid primitive declarations and constructor bypasses during compilation.
  • Verified attribute surface: Uses [StrongId<T>], [StringPrimitive], [NumericPrimitive<T>], [DatePrimitive], [SmartEnum<T>], [ValueObject], plus 39+ semantic shortcuts ([Email], [Phone], [IBAN], [Money], etc.).
Package AOT Status Role
EricksonLopez.DomainPrimitives Full Core attributes, PrimitiveBuilder, AmortizationScheduleCalculator, diagnostics
EricksonLopez.DomainPrimitives.Abstractions Full (net8.0+) Contracts (IDomainPrimitive<TSelf, TValue>, IStrongId<TSelf, TValue>, PrimitiveError)
EricksonLopez.DomainPrimitives.AspNetCore / .SourceGenerators Full / NotApplicable Model binding, DomainPrimitiveValidationAttribute<TPrimitive, TValue>
EricksonLopez.DomainPrimitives.Dapper / .SourceGenerators Full / NotApplicable DapperDomainPrimitivesRegistration.RegisterAll()
EricksonLopez.DomainPrimitives.EFCore / .SourceGenerators Full / NotApplicable configurationBuilder.ConfigureDomainPrimitives()
EricksonLopez.DomainPrimitives.OpenApi / .SourceGenerators Full / NotApplicable options.SchemaFilter<DomainPrimitivesSchemaFilter>() Swagger schema registration
EricksonLopez.DomainPrimitives.Testing Partial DomainPrimitiveFakeFactory, DomainPrimitiveScenarios, Verify extensions (EnableTrimAnalyzer=false)
EricksonLopez.DomainPrimitives.NewtonsoftJson Incompatible Legacy Newtonsoft.Json adapter (IsAotCompatible=false, EnableTrimAnalyzer=false)
EricksonLopez.DomainPrimitives.Analyzers / .Generators NotApplicable Roslyn analyzers (DP0001–DP0018) and generators (DP1001–DP1005)

Measured directly from BenchmarkDotNet.Artifacts (151 measured rows on .NET 8/.NET 9/.NET 10 X64 RyuJIT; 4 na_error rows in StructLayoutBenchmark excluded):

  • ComparativeBenchmarks.Dapper_TypeHandler_Parse: 0.8982–0.9405 ns / 0 B
  • DomainPrimitiveBenchmarks.PrimitiveEmail_Create: 110.70 ns / 0 B