Configuración e Integraciones — SharedKernel
Integración con EF Core, Dapper y OpenTelemetry
Sección titulada «Integración con EF Core, Dapper y OpenTelemetry»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):DapperStrongIdRegistry.Register<TId, TValue>()yDapperBclTypeHandlerRegistry. - JSON (
EricksonLopez.SharedKernel.Json):StrongIdJsonConverter<TSelf, TValue>yStrongIdJsonConverterFactory. - OpenTelemetry (
EricksonLopez.SharedKernel.OpenTelemetry):AddSharedKernelInstrumentation().