Andrew.Domain.SharedKernel 1.1.5

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

🧩 Domain.SharedKernel

Domain.SharedKernel is a clean, reusable shared library tailored for Domain-Driven Design (DDD) applications. It encapsulates core domain logic, base entity definitions, Snowflake ID generation, and abstraction contractsβ€”ideal for use across multiple bounded contexts or microservices.


πŸ“¦ Installation

Install via NuGet:

.NET CLI

dotnet add package Andrew.Domain.SharedKernel

Package Manager

NuGet\Install-Package Andrew.Domain.SharedKernel

πŸš€ Getting Started

1. Install in the Domain Layer of your solution.

2. Add configuration to appsettings.json:

"Snowflake": {
  "WorkerId": 1
}

ℹ️ Use different WorkerIds for each microservice instance or physical machine to avoid ID collisions.

3. Register services via Dependency Injection (in Infra layer or Program.cs):

services.AddDomainShardKernelCollection(configuration);

πŸ“¦ What's Included

βœ… BaseEntity

A common abstract base class for domain entities, offering:

  • Unique identifier with Snowflake ID generation
  • Domain event support (using [MediatR])

πŸ” HashHelper

A utility class for secure hash generation:

  • SHA256
  • MD5

Useful for token generation, password hashing, and more.

❄️ Snowflake ID Generator

Generates globally unique 64-bit IDs based on time and machine identity. Perfect for distributed systems that require high-performance and collision-free ID generation.

🧩 Core Domain Abstractions

Includes key interfaces for domain architecture:

  • IAggregateRoot – Marks an entity as an aggregate root.
  • ICurrentUser – Access the current user context (UserId, TenantId, etc.).
  • IUnitOfWork – Defines transactional boundaries for your repositories.

πŸ’‘ Why Use a Shared Kernel?

Implementing a Shared Kernel brings:

  • πŸ” Consistency across bounded contexts
  • 🧼 Separation of domain logic from infrastructure concerns
  • πŸ”„ Reusability across projects and microservices
  • πŸ“ Clarity through standard interfaces and patterns

πŸ“„ License

MIT License


Product 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 was computed.  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. 
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 Andrew.Domain.SharedKernel:

Package Downloads
Andrew.Infrastructure.SharedKernel

Making it easier to use Infrastructure layer in DDD. Contains Unit of Work,AppHelper,Dbcontext,CurrentUser .

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.5 128 7/5/2025
1.1.4 73 7/5/2025
1.1.3 144 6/24/2025
1.1.2 138 6/24/2025
1.1.1 194 6/23/2025
1.1.0 131 6/23/2025
1.0.0 142 6/22/2025