Dev.HuntKit 1.0.0

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

Dev.HuntKit

NuGet License: MIT .NET 8

A .NET 8 class library providing reusable infrastructure utilities.

Module Description
SQL Server Parameterized ADO.NET via SqlExecutor + SqlConditions
PostgreSQL Parameterized ADO.NET via PostgresExecutor + PostgresConditions
Kafka Producer + transactional outbox/inbox (backed by SQL Server)
RabbitMQ Producer + transactional outbox/inbox (backed by SQL Server)
NATS Producer + transactional outbox/inbox (backed by SQL Server)
MongoDB Connection factory + CRUD helpers with filter builders
S3 Storage MinIO/S3-compatible file operations with Polly retry
Extensions DateTime, object, DataTable, IList helpers
Health Checks One IHealthCheck per module via HealthCheckExtension
Metrics OpenTelemetry Counter + Histogram per module

Installation

dotnet add package Dev.HuntKit

SQL Server

using var cnn = new SqlExecutor(connStr);
var table = await cnn.CreateDataTableAsync(
    "SELECT * FROM Orders WHERE Status = @Status",
    [new("Status", 1)]);
if (cnn.LastError != null) Console.WriteLine(cnn.LastError.Message);

Kafka

builder.Services.AddKafkaService();          // producer only
builder.Services.AddKafkaService().AddKafkaOutbox(); // + outbox/inbox worker
var result = await producer.PublishProducerAsync("my-topic", payload);
// StatusID: 1=ok  2=not persisted  0=uncertain

appsettings.json:

{ "KafkaConfig": { "Brokers": "localhost:9092", "username": "", "password": "", "ProjectName": "my-service" } }

RabbitMQ

builder.Services.AddRabbitMQService();
builder.Services.AddRabbitMQService().AddRabbitMQOutbox();
var result = await producer.PublishProducerAsync("my.exchange", "orders.created", payload);
// StatusID: 1=ok  2=failed

appsettings.json:

{ "RabbitMQConfig": { "Host": "localhost", "Username": "guest", "Password": "guest", "ProjectName": "my-service" } }

NATS

builder.Services.AddNatsService();
builder.Services.AddNatsService().AddNatsOutbox();
var result = await producer.PublishProducerAsync("orders.created", payload);
// StatusID: 1=ok  2=failed

appsettings.json:

{ "NatsConfig": { "Url": "nats://localhost:4222", "ProjectName": "my-service" } }

MongoDB

builder.Services.AddMongoDBService();
// or multiple databases:
var conn = MongoDBConnectionFactory.Connect("mongodb://localhost:27017", "MyDB");
var filter = MongoDBConnectionFactory.GenerateFilter<Order>(("Status", FilterOperator.Eq, 1));
var orders = await conn.GetAllAsync<Order>("orders", filter);

appsettings.json:

{ "MongoConfig": { "ConnectionString": "mongodb://localhost:27017", "Database": "MyDB" } }

S3 / MinIO

builder.Services.AddS3Service();
var result = await s3.UploadFileAsync(new UploadFileModel {
    FileName = "file.pdf", FileStream = stream, IsPrivate = false
});
// StatusCode: 1=success 2=failed

appsettings.json:

{ "S3Config": { "Server": "localhost:9000", "AccessKey": "key", "SecretKey": "secret" }, "KafkaConfig": { "ProjectName": "...

Health Checks

builder.Services.AddHealthChecks()
    .AddSqlServerHealthCheck()
    .AddKafkaHealthCheck()
    .AddRabbitMQHealthCheck()
    .AddNatsHealthCheck()
    .AddMongoDBHealthCheck()
    .AddS3HealthCheck();

OpenTelemetry Metrics

builder.Services.AddOpenTelemetry().WithMetrics(m => {
    m.AddMeter("Dev.HuntKit.Sql");
    m.AddMeter("Dev.HuntKit.Kafka");
    m.AddMeter("Dev.HuntKit.RabbitMQ");
    m.AddMeter("Dev.HuntKit.Nats");
    m.AddMeter("Dev.HuntKit.Mongo");
    m.AddMeter("Dev.HuntKit.S3");
});

Configuration Reference

Module Required Keys
SQL Server ConnectionStrings:ConnectionString
Kafka KafkaConfig:Brokers, KafkaConfig:username, KafkaConfig:password, KafkaConfig:ProjectName
RabbitMQ RabbitMQConfig:Host, RabbitMQConfig:Username, RabbitMQConfig:Password, RabbitMQConfig:Project...
NATS NatsConfig:Url, NatsConfig:ProjectName
MongoDB MongoConfig:ConnectionString, MongoConfig:Database
S3 S3Config:Server, S3Config:AccessKey, S3Config:SecretKey, KafkaConfig:ProjectName

License

MIT (c) 2025 tuankhoi

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.0.0 117 3/31/2026