Andrew.Infrastructure.SharedKernel
1.0.0
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
<PackageReference Include="Andrew.Infrastructure.SharedKernel" Version="1.0.0" />
<PackageVersion Include="Andrew.Infrastructure.SharedKernel" Version="1.0.0" />
<PackageReference Include="Andrew.Infrastructure.SharedKernel" />
paket add Andrew.Infrastructure.SharedKernel --version 1.0.0
#r "nuget: Andrew.Infrastructure.SharedKernel, 1.0.0"
#:package Andrew.Infrastructure.SharedKernel@1.0.0
#addin nuget:?package=Andrew.Infrastructure.SharedKernel&version=1.0.0
#tool nuget:?package=Andrew.Infrastructure.SharedKernel&version=1.0.0
๐ ๏ธ 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 | 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 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. |
-
net8.0
- Andrew.Domain.SharedKernel (>= 1.1.1)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.EntityFrameworkCore (>= 9.0.6)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.