Skip to content

Search EricksonLopez.* Ecosystem

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

Configuration & Persistence Integrations — SharedKernel

L1StableNuGet: v4.0.0Local HEAD: v5.0.1AOT: Full

Register DomainEventsInterceptor (DomainEventDispatchTiming.AfterCommit is the v4.0.0 default) and configure strongly-typed ID value converters without reflection:

using EricksonLopez.SharedKernel.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Example.SharedKernelConfig;
public static class PersistenceConfiguration
{
public static void Register(IServiceCollection services)
{
services.AddSharedKernelDomainEventsInterceptor();
}
public static void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
configurationBuilder.ConfigureStrongIdsFromAssembly(typeof(PersistenceConfiguration).Assembly);
}
}
  • Dapper (EricksonLopez.SharedKernel.Dapper): Register strongly-typed IDs via DapperStrongIdRegistry.Register<TId, TValue>() (or RegisterByConvention) and BCL types (DateOnly, DateTimeOffset, TimeOnly) via DapperBclTypeHandlerRegistry.
  • JSON (EricksonLopez.SharedKernel.Json): Use StrongIdJsonConverter<TSelf, TValue>, StrongIdJsonConverterFactory, and SharedKernelJsonModifiers.IgnoreLegacyDomainEventAliases.
  • OpenTelemetry (EricksonLopez.SharedKernel.OpenTelemetry): Call tracerBuilder.AddSharedKernelInstrumentation() and meterBuilder.AddSharedKernelInstrumentation().