PubSea.Framework
10.0.18
dotnet add package PubSea.Framework --version 10.0.18
NuGet\Install-Package PubSea.Framework -Version 10.0.18
<PackageReference Include="PubSea.Framework" Version="10.0.18" />
<PackageVersion Include="PubSea.Framework" Version="10.0.18" />
<PackageReference Include="PubSea.Framework" />
paket add PubSea.Framework --version 10.0.18
#r "nuget: PubSea.Framework, 10.0.18"
#:package PubSea.Framework@10.0.18
#addin nuget:?package=PubSea.Framework&version=10.0.18
#tool nuget:?package=PubSea.Framework&version=10.0.18
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);
Related packages
| 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 | Versions 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. |
-
net10.0
- Grpc.Core.Api (>= 2.80.0)
- HttpClientToCurl (>= 2.2.0)
- IdGen (>= 3.0.7)
- Mapster.DependencyInjection (>= 10.0.11)
- Microsoft.EntityFrameworkCore (>= 10.0.10)
- Microsoft.EntityFrameworkCore.InMemory (>= 10.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.10)
- Microsoft.Extensions.Caching.Hybrid (>= 10.8.0)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 10.0.10)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.21.0)
- Newtonsoft.Json (>= 13.0.4)
- protobuf-net.Grpc (>= 1.2.2)
- RedLock.net (>= 2.3.2)
- Sqids (>= 3.2.1)
- System.IdentityModel.Tokens.Jwt (>= 8.21.0)
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 |