NDB.Kit
1.0.4
dotnet add package NDB.Kit --version 1.0.4
NuGet\Install-Package NDB.Kit -Version 1.0.4
<PackageReference Include="NDB.Kit" Version="1.0.4" />
<PackageVersion Include="NDB.Kit" Version="1.0.4" />
<PackageReference Include="NDB.Kit" />
paket add NDB.Kit --version 1.0.4
#r "nuget: NDB.Kit, 1.0.4"
#:package NDB.Kit@1.0.4
#addin nuget:?package=NDB.Kit&version=1.0.4
#tool nuget:?package=NDB.Kit&version=1.0.4
NDB.Kit
Application productivity kit for modern .NET applications.
NDB.Kit is a lightweight helper library that sits above infrastructure and below business logic, designed to reduce repetitive boilerplate in clean and modular .NET architectures.
This library is intentionally opinionated but framework-agnostic.
What does NDB.Kit provide?
NDB.Kit bundles several small but powerful building blocks:
- AutoMapper convention-based mapping
- EF Core guardrails and audit integration
- Enum and primitive parsing helpers
- Guard clauses for validation
- Collection and string utilities
- Result helpers integrated with
NDB.Abstraction
All modules are optional and can be used independently.
Design Principles
- No business logic
- No UI or HTTP concerns
- No DAL replacement
- Safe defaults (e.g.
AsNoTracking) - Explicit, readable, and testable
- Open-source friendly
Installation
dotnet add package NDB.Kit
Modules Overview
Mapping (AutoMapper)
Define mappings by implementing simple marker interfaces.
using NDB.Kit.Mapping;
using AutoMapper;
public class VehicleResponse : IMapFrom<Vehicle>
{
public Guid Id { get; set; }
public string EngineNumber { get; set; }
public void Mapping(IMappingExpression<Vehicle, object> map)
{
map.ForMember(d => d.EngineNumber,
opt => opt.MapFrom(s => s.EngineNumber.Trim()));
}
}
Register once:
services.AddAutoMapper(cfg =>
{
cfg.AddProfile(new AutoMappingProfile());
}, Assembly.GetExecutingAssembly());
EF Core Helpers
Guard Clauses
Guard.AgainstNull(request);
Guard.AgainstEmpty(request.EngineNumber, nameof(request.EngineNumber));
Guard.AgainstDefault(request.CompanyId, nameof(request.CompanyId));
Enum Parsing
var status = EnumHelper.ParseOrDefault(
request.Status,
ProductionStatusEnum.Unknown);
Primitive Parsing
var lot = Parse.Int(request.Lot);
var amount = Parse.Decimal(request.Amount);
var id = Parse.Guid(request.Id);
Returns nullable values instead of throwing.
Collection Helpers
foreach (var (index, item) in items.WithIndex())
{
Console.WriteLine($"{index}. {item}");
}
String Normalization
var code = StringNormalize.Normalize(
input,
removeWhitespace: true,
upper: true);
Result Helpers (NDB.Abstraction)
return ResultGuard.NotFoundIfNull(vehicle, "Vehicle not found");
return ResultGuard.FailIf(
quantity <= 0,
"Quantity must be greater than zero");
What NDB.Kit is NOT
- Not a DAL
- Not a Web framework
- Not a UI helper library
- Not a validation framework
- Not a replacement for EF Core, AutoMapper, or MediatR
Related Libraries
NDB.Abstraction Request, result, validation, and common contracts.
NDB.Audit.EF EF Core audit trail with old/new values and actor tracking.
Each library is independent and can be used separately.
Final Notes
If you are building a clean architecture, modular monolith, or enterprise-grade .NET system, NDB.Kit helps you stay productive without sacrificing clarity or control.
| 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
- AutoMapper (>= 13.0.1)
- DocumentFormat.OpenXml (>= 3.4.1)
- Microsoft.EntityFrameworkCore.Abstractions (>= 8.0.24)
- NDB.Abstraction (>= 1.0.8)
- NDB.Audit.EF (>= 1.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.