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" />
<PackageReference Include="Dev.HuntKit" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Dev.HuntKit&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dev.HuntKit
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 | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Confluent.Kafka (>= 2.11.0)
- Microsoft.Data.SqlClient (>= 6.0.2)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.5)
- Microsoft.Extensions.Hosting (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Minio (>= 6.0.5)
- MongoDB.Bson (>= 3.4.2)
- MongoDB.Driver (>= 3.4.2)
- NATS.Net (>= 2.4.0)
- Newtonsoft.Json (>= 13.0.3)
- Npgsql (>= 8.0.7)
- Polly (>= 8.4.2)
- RabbitMQ.Client (>= 7.0.0)
- System.Configuration.ConfigurationManager (>= 8.0.1)
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 |