KUKULCAN.SharedKernel.Database
1.0.1
See the version list below for details.
dotnet add package KUKULCAN.SharedKernel.Database --version 1.0.1
NuGet\Install-Package KUKULCAN.SharedKernel.Database -Version 1.0.1
<PackageReference Include="KUKULCAN.SharedKernel.Database" Version="1.0.1" />
<PackageVersion Include="KUKULCAN.SharedKernel.Database" Version="1.0.1" />
<PackageReference Include="KUKULCAN.SharedKernel.Database" />
paket add KUKULCAN.SharedKernel.Database --version 1.0.1
#r "nuget: KUKULCAN.SharedKernel.Database, 1.0.1"
#:package KUKULCAN.SharedKernel.Database@1.0.1
#addin nuget:?package=KUKULCAN.SharedKernel.Database&version=1.0.1
#tool nuget:?package=KUKULCAN.SharedKernel.Database&version=1.0.1
KUKULCAN.SharedKernel.Database
Overview
KUKULCAN.SharedKernel.Database is the shared persistence and Entity Framework Core infrastructure module used by KUKULCAN applications and bounded contexts. It builds on KUKULCAN.SharedKernel and centralizes database cross-cutting concerns without introducing business-domain rules into the shared domain model.
The library targets .NET 10 and EF Core 10. Provider packages are deliberately supplied by consuming applications or infrastructure projects.
Responsibilities
KukulcanDbContextBasefor common EF Core configuration.- SQL Server and PostgreSQL provider selection through
DatabaseProvider. - Strongly typed configuration through
KukulcanDatabaseOptions. IUnitOfWorkandUnitOfWork<TContext>for persistence and explicit transactions.- Audit timestamp population through SharedKernel
IAuditable. - Soft-delete conversion and filtering through SharedKernel
ISoftDelete. - Persistence-level tenant isolation through
ITenantContextandTenantId. - Domain-event dispatch after successful persistence.
- Append-only enforcement through
IImmutable. - Slow-query diagnostics through
SlowQueryInterceptor. - Dependency-injection registration helpers.
Architectural Boundary
This project is infrastructure, not a second domain kernel. It consumes stable contracts from KUKULCAN.SharedKernel and keeps persistence-only abstractions local. It must not contain bounded-context business rules, application services, CQRS handlers or generic repositories.
KUKULCAN.SharedKernel
^
|
KUKULCAN.SharedKernel.Database
^
|
consuming Infrastructure / Host applications
Project Structure
KUKULCAN.SharedKernel.Database/
├── Source/KUKULCAN.SharedKernel.Database/
│ ├── Abstractions/
│ ├── Configuration/
│ ├── Extensions/
│ ├── Interceptors/
│ ├── UnitOfWork/
│ └── KukulcanDbContextBase.cs
└── SourceClient/
Core Components
KukulcanDbContextBase
Provides common provider configuration, model-configuration discovery, global filters and persistence interceptors for derived module contexts.
Persistence Interceptors
| Component | Responsibility |
|---|---|
AuditSaveChangesInterceptor |
Sets CreatedOn for added auditable entities and ModifiedOn for modified entities. |
SoftDeleteInterceptor |
Converts deletes of ISoftDelete entities into logical deletes and records DeletedOn. |
DomainEventDispatchInterceptor |
Dispatches pending domain events after a successful save and clears them. |
ImmutableEntityInterceptor |
Rejects updates and deletes of IImmutable entities. |
SlowQueryInterceptor |
Logs commands exceeding SlowQueryThresholdMs. |
Unit of Work
IUnitOfWork exposes asynchronous saving and explicit transaction lifecycle operations. Repository abstractions are intentionally outside this package.
Tenant Isolation
ITenantContext supplies the current Guid tenant identifier. ApplyTenantFilter applies a global filter to entity types that expose a Guid TenantId property. Tenant awareness remains a persistence concern and is not added to SharedKernel merely for EF Core support.
Providers
The core package does not reference provider packages. Consumers add the provider they need, such as Microsoft.EntityFrameworkCore.SqlServer or Npgsql.EntityFrameworkCore.PostgreSQL. The current DatabaseProvider enum supports SqlServer and PostgresSql.
Configuration
Options are bound from Kukulcan:Database. Sensitive-data logging is disabled by default and should remain disabled in production.
Registration
services.AddKukulcanDbContext<MyModuleDbContext>(configuration);
The registration helper binds options, registers the context, registers IUnitOfWork and registers the slow-query interceptor.
Requirements
- .NET 10
KUKULCAN.SharedKernel1.0.0 or compatible- EF Core 10
- Microsoft.Extensions Options, DI, Logging and Configuration abstractions 10
- A database provider package supplied by the consuming project when required
Quality
Nullable reference types are enabled, warnings are treated as errors and XML documentation generation is enabled. Public APIs are documented and persistence behavior is intended to be covered by behavior-focused tests.
License
See the repository LICENSE file for the applicable GPL terms.
| 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
- KUKULCAN.SharedKernel (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.11)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.11)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.9)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on KUKULCAN.SharedKernel.Database:
| Package | Downloads |
|---|---|
|
KUKULCAN.SharedKernel.Auth
Provides authentication and authorization components for the KUKULCAN architecture, including local authentication, federated credential validation, multi-tenant identity management, user and tenant membership handling, and authentication infrastructure. Designed to provide consistent, reusable, and secure authentication capabilities across KUKULCAN applications and services. |
GitHub repositories
This package is not used by any popular GitHub repositories.
This hotfix fixes the following:
- In the ASP.NET Core DI container, the correct thing to do is to request ILogger<T>, not the concrete Logger<T> implementation.