PubSea.Framework 10.0.18

dotnet add package PubSea.Framework --version 10.0.18
                    
NuGet\Install-Package PubSea.Framework -Version 10.0.18
                    
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="10.0.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PubSea.Framework" Version="10.0.18" />
                    
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 10.0.18
                    
#r "nuget: PubSea.Framework, 10.0.18"
                    
#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@10.0.18
                    
#: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=10.0.18
                    
Install as a Cake Addin
#tool nuget:?package=PubSea.Framework&version=10.0.18
                    
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 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 (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
10.0.18 129 7/23/2026
10.0.17 128 7/23/2026
10.0.16 129 7/16/2026
10.0.15 146 7/2/2026
10.0.14 163 6/18/2026
10.0.13 152 6/11/2026
10.0.12 151 5/30/2026
10.0.11 111 5/30/2026
10.0.10 148 5/26/2026
10.0.9 147 3/30/2026
10.0.8 158 3/10/2026
10.0.7 147 2/26/2026
10.0.6 157 1/30/2026
10.0.5 165 1/8/2026
10.0.4 166 12/29/2025
10.0.3 337 12/18/2025
10.0.2 493 12/11/2025
10.0.1 255 11/26/2025
10.0.0 358 11/13/2025
9.2.18 215 11/7/2025
Loading failed