Andrew.Infrastructure.SharedKernel 1.0.0

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

๐Ÿ› ๏ธ Infrastructure.Shared.Kernel

A lightweight shared infrastructure kernel for .NET 8 projects, encapsulating reusable infrastructure concerns like DbContext base logic, soft-delete filtering, user context access, and domain event support.


๐Ÿ“ฆ Installation

Install via NuGet:

๐Ÿ“ Features

๐Ÿ”ง AppHelper.cs

Reads configuration values from appsettings.json and provides convenient static access helpers.

โœ… Simplifies configuration binding and access across different layers.


๐Ÿ—ƒ๏ธ BaseDbContext.cs

A custom DbContext base class that:

  • Automatically applies [soft delete filters] using IsDel flag.

โœ… Perfect base for all EF Core contexts in DDD-style applications.


๐Ÿ‘ค CurrentUser.cs

Provides a service to access current logged-in user context:

  • UserId

Typically bound to HttpContext via IHttpContextAccessor.

โœ… Useful for audit tracking and per-user operations.


๐Ÿ“‘ IUnitOfWork + UnitOfWork.cs

Handles transactional consistency and domain event publishing. Features:

  • Automatic audit data filling
  • Dispatches MediatR events for created/modified entities
  • Centralized SaveChangesAsync

โœ… Works seamlessly with your BaseDbContext and aggregates.



๐Ÿง  Design Principles

  • ๐Ÿ” Reusable across services
  • ๐Ÿ“ฆ Packaged as shared NuGet
  • ๐Ÿ‘ฅ Designed for DDD + Clean Architecture
  • ๐Ÿงช Unit-testable components

---

## ๐Ÿ“„ License

MIT License.

---

## ๐Ÿ‘ค Author

Created by **Andrew Wang**.
Contributions and issues welcome!
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 187 6/24/2025
1.0.0 132 6/23/2025