PubSea.Framework 11.0.0

dotnet add package PubSea.Framework --version 11.0.0
                    
NuGet\Install-Package PubSea.Framework -Version 11.0.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="PubSea.Framework" Version="11.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PubSea.Framework" Version="11.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PubSea.Framework" />
                    
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 PubSea.Framework --version 11.0.0
                    
#r "nuget: PubSea.Framework, 11.0.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 PubSea.Framework@11.0.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=PubSea.Framework&version=11.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PubSea.Framework&version=11.0.0
                    
Install as a Cake Tool

PubSea.Framework

ASP.NET Core building blocks for DDD services — domain events, EF Core unit of work, unified API responses, global error handling, Snowflake/HashId ID generation, Mapster mapping, Redis hybrid cache, and cURL health checks.

Install this package when you need production-ready cross-cutting utilities for ASP.NET Core Web APIs. For CQRS/mediator use PubSea.Mediator. For transactional outbox/inbox messaging use PubSea.Messaging.EntityFramework.

Install

dotnet add package PubSea.Framework

Requires .NET 10 (ASP.NET Core).

Quick start

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();
builder.Services.AddSeaEventDispatcher();  // domain events + auto-discovered handlers
builder.Services.AddSeaMapper();           // Mapster-based mapping
builder.Services.AddEfUnitOfWork<AppDbContext>();
builder.Services.AddSnowflakeService();
builder.Services.AddHashIdService();

var app = builder.Build();

app.UseSeaMapper();
app.UseSeaEventDispatcher();
app.UseMiddleware<WebErrorHandlerMiddleware>();

app.MapControllers();
app.Run();

What you get

Area APIs
DDD Entity<T>, AggregateRoot<T>, IAuditable, IEvent, IDomainEvent, IEventHandler<T>, IEventDispatcher
Unit of work AddEfUnitOfWork<TDbContext>(), IEfUnitOfWork with transactions and execution strategy
API responses ToActionResult() extensions — consistent { result: ... } envelope and 201 Created helpers
Error handling WebErrorHandlerMiddleware, SeaException with trace IDs and normalized problem payloads
Mapping AddSeaMapper(), ISeaMapper, SeaTypeAdapterConfig (Mapster)
IDs ISnowflakeService (time-ordered IDs), IHashIdService (Sqids encode/decode)
Health checks AddCurlHealthCheck() — synthetic HTTP checks with aggressive timeouts
HTTP debugging HttpErrorLoggerMessageHandler — logs failed outbound calls as reproducible cURL
Caching AddSeaRedisHybridCache() — Microsoft Hybrid Cache + StackExchange.Redis
Session logout (SLO) AddSeaIdentityProviderSlo() + TerminatedSessionsMiddleware
Date/time IDateTimeService with Persian (Jalali) calendar conversion
Files ISeaFileService — save files and build presigned URLs
EF diagnostics AddSeaHeavyQueryInterceptor() — log slow queries

Examples

Unified API responses

[HttpGet("{id}")]
public IActionResult Get(long id)
    => new { id, email = "user@example.com" }.ToActionResult();

[HttpPost]
public IActionResult Create([FromBody] CreateUserRequest req)
    => new { id = 1L }.ToActionResult("/users/1");  // 201 Created

Domain events

public sealed class UserCreated : IEnrichedDomainEvent
{
    public long UserId { get; init; }
    public long EventId { get; set; }
    public DateTime PublishedUtcDateTime { get; set; }
}

public sealed class SendWelcomeEmailHandler : IEventHandler<UserCreated>
{
    public Task Handle(UserCreated evt, CancellationToken ct = default)
        => Task.CompletedTask;
}

// After SaveChanges:
SeaEventHelper.InitializeEvents(evt);
await eventDispatcher.Dispatch([evt], ct);

Snowflake + HashId

builder.Services.AddSnowflakeService(o => o.GeneratorId = 1);
builder.Services.AddHashIdService(o => o.MinHashLength = 12);

var id = snowflake.CreateId();
var publicId = hashId.Encode(id);
Package Use when
PubSea.Mediator CQRS commands/queries with Send / Publish
PubSea.Messaging.EntityFramework EF Core outbox/inbox for reliable messaging
PubSea.Messaging.EntityFramework.Kafka Kafka transport
PubSea.Messaging.EntityFramework.RabbitMq RabbitMQ transport

Full documentation

Complete guides, samples, and architecture notes: github.com/PubSea/Framework

Sample app: Qualifiers/00-RestApi

License

MIT

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on PubSea.Framework:

Package Downloads
PubSea.Messaging.EntityFramework

Enterprise-ready .NET service bus and messaging framework for building resilient distributed systems and event-driven microservices. Supports message publishing, command processing, event-driven workflows, asynchronous communication, reliable delivery patterns, and extensible integrations for modern .NET applications. Designed for developers who need a clean, flexible, and high-performance alternative for service-to-service communication.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.0 75 11/23/2026
10.0.23 155 10/30/2026
10.0.22 150 9/24/2026
10.0.21 151 9/11/2026
10.0.20 180 8/20/2026
10.0.19 157 8/9/2026
10.0.18 166 7/23/2026
10.0.17 169 7/23/2026
10.0.16 165 7/16/2026
10.0.15 174 7/2/2026
10.0.14 185 6/18/2026
10.0.13 179 6/11/2026
10.0.12 175 5/30/2026
10.0.11 134 5/30/2026
10.0.10 170 5/26/2026
10.0.9 173 3/30/2026
10.0.8 183 3/10/2026
10.0.7 166 2/26/2026
10.0.6 181 1/30/2026
10.0.5 185 1/8/2026
Loading failed