Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore --version 0.1.0
                    
NuGet\Install-Package Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore --version 0.1.0
                    
#r "nuget: Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore&version=0.1.0
                    
Install as a Cake Tool

Cayaqui.MPS.BuildingBlocks.EntityFrameworkCore

Integración EF Core para Cayaqui.MPS.BuildingBlocks. Provider-agnóstico (Relational).

Qué incluye

Área Tipos
Outbox OutboxMessage, IOutboxStore/IOutboxPurgeable, EfOutboxStore<TDbContext>, OutboxMessageConfiguration, IOutboxMessageDispatcher, OutboxRedispatchHostedService<TDbContext>, OutboxPurgeHostedService<TDbContext>, OutboxHealthCheck<TDbContext>
Interceptors AuditSaveChangesInterceptor (sella CreatedBy/UpdatedBy), DomainEventDispatchInterceptor (despacha eventos post-commit)
CQRS Blazor-safe ScopedQueryHandler<TQuery,TResponse,TDbContext>, ScopedCommandHandler<...> — DbContext efímero por llamada vía IDbContextFactory
DI AddModuleOutbox<TDbContext>(), AddOutboxBackgroundServices<TDbContext>(), AddBuildingBlocksInterceptors()

Setup

builder.Services.AddDomainEvents();                 // del paquete base
builder.Services.AddScoped<ICurrentUserService, MyCurrentUserService>();
builder.Services.AddBuildingBlocksInterceptors();
builder.Services.AddModuleOutbox<AppDbContext>();
builder.Services.AddOutboxBackgroundServices<AppDbContext>();

builder.Services.AddDbContextFactory<AppDbContext>((sp, o) =>
    o.UseNpgsql(cs).AddInterceptors(
        sp.GetRequiredService<AuditSaveChangesInterceptor>(),
        sp.GetRequiredService<DomainEventDispatchInterceptor>()));

DbContext

protected override void OnModelCreating(ModelBuilder b)
    => b.ApplyConfiguration(new OutboxMessageConfiguration());

CQRS scoped (Blazor Server)

public sealed class GetProjectsHandler(IDbContextFactory<AppDbContext> f)
    : ScopedQueryHandler<GetProjectsQuery, List<ProjectDto>, AppDbContext>(f)
{
    protected override async Task<List<ProjectDto>> ExecuteAsync(AppDbContext db, GetProjectsQuery q, CancellationToken ct)
        => await db.Projects.Select(p => new ProjectDto(p)).ToListAsync(ct);
}

Usa IDbContextFactory para un DbContext efímero por llamada — seguro bajo renders concurrentes de un circuito Blazor Server.

Outbox redispatch

Implementá IOutboxMessageDispatcher (deserializa Type+Payload y publica) para activar OutboxRedispatchHostedService. Sin esa implementación el servicio queda inactivo. Tras MaxRetries (5) fallos un mensaje se marca IsPermanentlyFailed; OutboxHealthCheck lo reporta como Degraded.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.1 98 6/5/2026
0.5.0 95 6/4/2026
0.4.0 149 5/31/2026
0.3.0 95 5/30/2026
0.2.0 90 5/30/2026
0.1.0 105 5/30/2026

0.1.0 — Initial release. EF Core integration for Cayaqui.MPS.BuildingBlocks: Outbox (OutboxMessage + EfOutboxStore + OutboxMessageConfiguration + redispatch/purge hosted services + health check), AuditSaveChangesInterceptor + DomainEventDispatchInterceptor, ScopedQueryHandler/ScopedCommandHandler (IDbContextFactory), AddModuleOutbox/AddOutboxBackgroundServices/AddBuildingBlocksInterceptors DI extensions.