Getting Started with EricksonLopez
Welcome to the EricksonLopez developer documentation. This guide establishes the verified steps to bootstrap a .NET 8 / .NET 9 / .NET 10 solution aligned with Clean Architecture, Domain-Driven Design invariants, explicit imports, and Native AOT awareness.
EricksonLopez.* is an MIT-licensed open-source .NET ecosystem composed of 27 active public repositories and 318 listed NuGet packages (plus Roslyn incremental source generators and analyzers). It replaces runtime reflection magic, exception-driven business control flow, and black-box ORM query generation with compile-time contracts, zero-allocation value-type Result outcomes, and explicit SQL persistence.
Enterprise .NET codebases frequently degrade through three avoidable patterns:
- Exceptions as business control flow: Throwing exceptions for expected validation or domain rejections forces stack unwinding and obscures method contracts.
- Implicit runtime magic: Hidden global usings, assembly scanning, and reflection-based convention wiring create trimming/Native AOT failures and unpredictable startup behavior.
- Unpredictable ORM query generation: Dynamic query translation can emit suboptimal joins or inefficient row-by-row updates during batch ingestion.
The ecosystem addresses these directly:
EricksonLopez.Result(3.0.0):readonly structrailway error handling with Roslyn analyzers (RESULT001–RESULT013) and ASP.NET Core ProblemDetails integration.EricksonLopez.DomainPrimitives(3.0.0): Incremental Roslyn generators for[StrongId<T>],[StringPrimitive],[NumericPrimitive<T>], and AOT-readyIParsable<T>/IUtf8SpanParsable<T>implementations.EricksonLopez.DapperExtensions(2.0.0): Explicit raw-SQL Unit of Work, transient error resilience, andEricksonLopez.DapperExtensions.PostgreSqlUNNESTbatch operations.EricksonLopez.Outbox(3.0.0): Transactional outbox persistence and deduplicating inbox (EricksonLopez.Inbox,3.0.0) with pooled buffer serialization.
EricksonLopez.Result serves as the L0 foundational hub across 21 sibling library families (20 published + 1 unpublished local observability):
dotnet add package EricksonLopez.Result --version 3.0.0<PackageReference Include="EricksonLopez.Result" Version="3.0.0" /><PackageVersion Include="EricksonLopez.Result" Version="3.0.0" />1. Enforce Build Invariants (Directory.Build.props)
Section titled “1. Enforce Build Invariants (Directory.Build.props)”Create a Directory.Build.props file at the solution root to enforce explicit imports, trim analysis, warnings as errors, and strong-name signing:
<Project> <PropertyGroup> <TargetFramework>net10.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>disable</ImplicitUsings> <EnableTrimAnalyzer>true</EnableTrimAnalyzer> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <SignAssembly>true</SignAssembly> <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)EricksonLopez.snk</AssemblyOriginatorKeyFile> </PropertyGroup></Project>2. Add Layer Packages
Section titled “2. Add Layer Packages”# L0 & L1 Domain / Error Foundationsdotnet add package EricksonLopez.Result --version 3.0.0dotnet add package EricksonLopez.DomainPrimitives --version 3.0.0dotnet add package EricksonLopez.SharedKernel --version 4.0.0
# L2 Application & Reliabilitydotnet add package EricksonLopez.Mediator --version 2.0.0dotnet add package EricksonLopez.Idempotency.Abstractions --version 2.0.03. Implement a Domain Entity with Explicit Contracts
Section titled “3. Implement a Domain Entity with Explicit Contracts”Notice that <ImplicitUsings>disable</ImplicitUsings> requires explicit using directives, [StrongId<Guid>] generates the strongly-typed identifier via EricksonLopez.DomainPrimitives, and Result / Result<T> represents success or domain failure without exceptions:
using System;using EricksonLopez.DomainPrimitives;using EricksonLopez.Result;using EricksonLopez.SharedKernel;
namespace Example.Domain.Orders;
[StrongId<Guid>]public readonly partial record struct OrderId;
public sealed record OrderCreatedDomainEvent(OrderId OrderId, decimal Total) : DomainEvent;
public sealed class Order : AggregateRoot<OrderId>{ public decimal Total { get; private set; }
private Order(OrderId id, decimal total) : base(id) { Total = total; }
public static Result<Order> Create(OrderId id, decimal total) { if (total <= 0m) { return Result.Failure<Order>(Error.Validation( "Order.InvalidTotal", "Order total must be greater than zero.")); }
var order = new Order(id, total); order.RaiseDomainEvent(new OrderCreatedDomainEvent(order.Id, order.Total)); return Result.Success(order); }}- Explore the EricksonLopez.Result Documentation for
Result,Result<T>,Error, and Roslyn analyzer rules. - Browse the Learning Center for architectural tracks covering Clean Architecture and the 15 Engineering Principles.
- Inspect all 27 active library families in the Libraries Catalog.