Geaux.SharedKernal
1.2.0
dotnet add package Geaux.SharedKernal --version 1.2.0
NuGet\Install-Package Geaux.SharedKernal -Version 1.2.0
<PackageReference Include="Geaux.SharedKernal" Version="1.2.0" />
<PackageVersion Include="Geaux.SharedKernal" Version="1.2.0" />
<PackageReference Include="Geaux.SharedKernal" />
paket add Geaux.SharedKernal --version 1.2.0
#r "nuget: Geaux.SharedKernal, 1.2.0"
#:package Geaux.SharedKernal@1.2.0
#addin nuget:?package=Geaux.SharedKernal&version=1.2.0
#tool nuget:?package=Geaux.SharedKernal&version=1.2.0
Geaux.SharedKernal
Foundational domain-driven building blocks for GeauxPlatform and modern .NET applications. Provides CQRS primitives, domain events, entity base classes, value objects, repository abstractions, audit trail, and soft delete support.
Geaux.SharedKernal provides the essential abstractions and base classes needed to implement Domain-Driven Design (DDD), CQRS, and clean architectural separation across your application. It is intentionally minimal, framework-agnostic, and highly reusable.
This library contains no Entity Framework, no ASP.NET Core hosting code, and no platform-specific dependencies β making it ideal for use in domain layers, use case layers, and NuGet packages.
β¨ Features
- π§± Entity base classes with domain event support
- π― ValueObject infrastructure with equality & comparison semantics
- π Domain events & dispatching abstractions
- π Mediator pipeline behaviors, including logging
- π¬ CQRS primitives (ICommand, IQuery, and handler interfaces)
- π Repository abstractions (
IRepository,IReadRepository) compatible with Specification pattern - π Auditable trail (
IAuditable) for created/modified timestamps - ποΈ Soft delete (
ISoftDelete) for logical deletion support - π¨ 100% frameworkβagnostic, usable in any architecture (Clean, Onion, Hexagonal)
π¦ Installation
dotnet add package Geaux.SharedKernal
π§± Core Building Blocks
Entities
EntityBase(int identifier)EntityBase<TId>(stronglyβtyped identifier)EntityBase<T, TId>(patternβfriendly base for typed IDs)IAggregateRoot(marker interface for aggregate roots)IAuditable(created/modified timestamps for audit trail)ISoftDelete(flag for logical deletion)
EntityBase
A base class for aggregate roots or domain entities.
Features:
- Automatic tracking of domain events
- Generic (
EntityBase<TId>) and non-generic versions - Equality based on identifier
- Hook for clearing/processing domain events
Example
public class Order : EntityBase<Guid>, IAggregateRoot
{
public DateTime CreatedOn { get; private set; } = DateTime.UtcNow;
}
ValueObject
Implements the classic DDD Value Object pattern using component-based equality.
Features:
- Automatic equality comparisons
- Sorting support via
IComparable - Semantic equality instead of object identity
Example
public class Money : ValueObject
{
public decimal Amount { get; }
public string Currency { get; }
public Money(decimal amount, string currency)
{
Amount = amount;
Currency = currency;
}
protected override IEnumerable<object> GetEqualityComponents()
{
yield return Amount;
yield return Currency;
}
}
π Domain Events
Domain events allow aggregates to publish meaningful system changes.
DomainEventBase
public abstract class DomainEventBase : INotification
{
public DateTime DateOccurred { get; } = DateTime.UtcNow;
}
Each event is attached to an entity and later dispatched.
IDomainEventDispatcher
Abstraction that hands domain events off to an external mechanism (such as MediatR).
MediatRDomainEventDispatcher
A concrete implementation using MediatR:
- Dispatches events after persistence completes
- Ensures reliable event handling patterns
π§ CQRS Abstractions
Geaux.SharedKernal defines command/query primitives compatible with MediatR.
Commands
public interface ICommand<TResult> : IRequest<TResult> { }
public interface ICommandHandler<TCommand, TResult>
: IRequestHandler<TCommand, TResult> where TCommand : ICommand<TResult>;
Queries
public interface IQuery<TResult> : IRequest<TResult> { }
public interface IQueryHandler<TQuery, TResult>
: IRequestHandler<TQuery, TResult> where TQuery : IQuery<TResult>;
These interfaces unify CQRS semantics across modules and improve discoverability.
π Repository Abstractions
This library defines two essential repository contracts.
IReadRepository<T>
Read-only operations using Specification pattern:
Task<T?> GetByIdAsync<TId>(TId id, CancellationToken cancellationToken);
Task<IReadOnlyList<T>> ListAsync(ISpecification<T> specification);
IRepository<T>
Adds stateful write capabilities:
Task AddAsync(T entity);
Task UpdateAsync(T entity);
Task DeleteAsync(T entity);
These interfaces pair with Geaux.Specification and Geaux.Specification.EntityFrameworkCore.
π Logging Behavior
Includes LoggingBehavior<TRequest, TResponse> to integrate into the MediatR pipeline:
- Logs request start/end
- Captures timing
- Helps track application flow consistently
π Architectural Role
Geaux.SharedKernal sits at the center of the dependency graph.
It may be referenced by:
- Domain projects (
Geaux.Core) - Use case projects (
Geaux.UseCases) - Infrastructure implementations (read-only)
It must not reference:
- EF Core
- ASP.NET Core
- Infrastructure
- UI or Presentation layers
This enforces pure domain compliance.
π Project Structure
Geaux.SharedKernal/
β
βββ CQRS/
β βββ ICommand.cs
β βββ ICommandHandler.cs
β βββ IQuery.cs
β βββ IQueryHandler.cs
β
βββ DomainEvents/
β βββ DomainEventBase.cs
β βββ IDomainEventDispatcher.cs
β βββ MediatRDomainEventDispatcher.cs
β βββ LoggingBehavior.cs
β
βββ Entities/
β βββ EntityBase.cs
β βββ EntityBase.TId.cs
β βββ ValueObject.cs
β βββ HasDomainEventsBase.cs
β βββ IAggregateRoot.cs
β
βββ Repositories/
β βββ IRepository.cs
β βββ IReadRepository.cs
β
βββ Geaux.SharedKernal.csproj
π Usage Summary
Geaux.SharedKernal provides:
- The base types for all domain models
- Building blocks for domain events
- Command/query abstractions
- Repository contracts
- MediatR pipeline utilities
It is the foundational library for building decoupled, testable, scalable applications following Clean Architecture and DDD practices.
π License
MIT License Β© Brent Lee Rigsby / GeauxCajunIT
π Repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Geaux.Specification (>= 1.2.0)
- MediatR (>= 14.0.0)
-
net9.0
- Geaux.Specification (>= 1.2.0)
- MediatR (>= 14.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Geaux.SharedKernal:
| Package | Downloads |
|---|---|
|
Geaux.Localization
Geaux.Localization is a database-backed localization provider for .NET with multi-tenant support, EF Core integration, culture fallback, attribute-based localization, and export/import tooling. |
|
|
Geaux.Localization.Admin
Geaux.Localization.Admin provides a plugβandβplay Razor Class Library admin dashboard for managing localization keys, cultures, translations, and language packs. Includes CSV/JSON/ZIP export and import tooling, missingβvalue repair, and multiβtenant support. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 344 | 12/17/2025 |
* Added IAuditable interface for created/modified timestamps
* Added ISoftDelete interface for logical deletion support
* Updated EntityBase to implement IEntityBase<TId> with audit trail
* Documentation improvements and DocFX stubs for new features