JT.UtilityManager
1.0.0
dotnet add package JT.UtilityManager --version 1.0.0
NuGet\Install-Package JT.UtilityManager -Version 1.0.0
<PackageReference Include="JT.UtilityManager" Version="1.0.0" />
<PackageVersion Include="JT.UtilityManager" Version="1.0.0" />
<PackageReference Include="JT.UtilityManager" />
paket add JT.UtilityManager --version 1.0.0
#r "nuget: JT.UtilityManager, 1.0.0"
#:package JT.UtilityManager@1.0.0
#addin nuget:?package=JT.UtilityManager&version=1.0.0
#tool nuget:?package=JT.UtilityManager&version=1.0.0
๐งฐ JT.UtilityManager
A modular and extensible .NET utility library that simplifies integration of core application features like caching (in-memory & Redis), health checks, CORS, and future-ready tools such as file conversion, email sender, logging, and more.
๐ GitHub Repository of JT.UtilityManager <br> ๐ GitHub Repository of Unit Test <br> ๐ GitHub Repository of Sample Demo to learn how to use it
๐ Features
| Category | Feature | Status |
|---|---|---|
| ๐ง Caching | In-Memory Cache | โ Ready |
| ๐ Distributed | Redis Cache (via StackExchange) | โ Ready |
| โค๏ธ Monitoring | Health Checks | โ Ready |
| ๐ Networking | CORS Policy Configuration | ๐ Planned |
| ๐ Conversion | Word, PDF, CSV, JSON (Planned) | ๐ Planned |
| ๐ง Communication | Email Sending | ๐ Planned |
| ๐ Security | Encryption/Decryption Utilities | ๐ Planned |
| ๐ Resiliency | Retry Policies | ๐ Planned |
| ๐ชต Logging | Abstracted Logging Helpers | ๐ Planned |
๐ฆ NuGet Installation
dotnet add package JT.UtilityManager
๐ Setup
Register Everything
builder.Services.AddUtilityManager(builder.Configuration);
Internally adds one by one according to the requirements:
builder.Services.AddInMemoryCaching();
builder.Services.AddRedisCaching();
builder.Services.AddHealthChecks();
builder.Services.AddCors();
โ๏ธ Configuration (Example)
{
"Redis": {
"ConnectionString": "localhost:6379"
}
}
๐งช Usage Examples
โ In-Memory Cache
public class ProductService
{
private readonly IInMemoryCache _cache;
public ProductService(IInMemoryCache cache)
{
_cache = cache;
}
public async Task<Product?> GetProductAsync(int id)
{
var key = $"product-{id}";
return await _cache.GetOrSetAsync(key, () =>
{
// Fetch from DB or any external source
return Task.FromResult(new Product { Id = id, Name = "Sample" });
}, TimeSpan.FromMinutes(10));
}
}
๐ Redis Distributed Cache
public class SessionService
{
private readonly IDistributedCacheService _redis;
public SessionService(IDistributedCacheService redis)
{
_redis = redis;
}
public async Task StoreSessionAsync(string userId, SessionData data)
{
await _redis.SetAsync($"session:{userId}", data, TimeSpan.FromHours(1));
}
public async Task<SessionData?> GetSessionAsync(string userId)
{
return await _redis.GetAsync<SessionData>($"session:{userId}");
}
}
โค๏ธ Health Check Endpoint
app.MapHealthChecks("/health");
๐ CORS Configuration
A default policy is already added:
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
});
You can override this in your own Program.cs.
๐ฉโ๐ป Contributing
Want to add logging, email, file conversion or encryption support? Great! Open an issue or submit a pull request.
Ideas to Contribute:
๐ JWT Helper or Auth Middlewares
๐ค SMTP + SendGrid email integration
๐ Telemetry wrapper for App Insights
๐ File parsing & format conversion (PDF/Excel)
๐ License
This library is licensed under the <a href="https://mit-license.org/"> MIT License</a>.
๐ Related Package on Nuget
<a href="https://www.nuget.org/packages/JT.SmartConfigManager/">SmartConfigManager</a>
Hi, I'm [Jayant Tripathy][<a href="https://jayanttripathy.com">website</a>] ๐ <img src="https://komarev.com/ghpvc/?username=JayantTripathy" alt="cprespider" align="center" />
๐ฑ Iโm currently learning advanced concepts of AWS and Azure
๐ฏ Iโm looking to collaborate with other content creators on [<a href="https://www.youtube.com/@JayantT">YouTube</a>]
๐ฅ 2024-2025 Goals: get 10k subscribers on YouTube
โก Fun fact: I love to watch cricket & listen to songs
๐ง Built and maintained with โค๏ธ by Jayant Tripathy
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. |
-
net9.0
- AspNetCoreRateLimit (>= 5.0.0)
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Logging (>= 9.0.0)
- StackExchange.Redis (>= 2.7.28)
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 | 236 | 7/13/2025 |