UtilBlast 2.0.0
dotnet add package UtilBlast --version 2.0.0
NuGet\Install-Package UtilBlast -Version 2.0.0
<PackageReference Include="UtilBlast" Version="2.0.0" />
<PackageVersion Include="UtilBlast" Version="2.0.0" />
<PackageReference Include="UtilBlast" />
paket add UtilBlast --version 2.0.0
#r "nuget: UtilBlast, 2.0.0"
#:package UtilBlast@2.0.0
#addin nuget:?package=UtilBlast&version=2.0.0
#tool nuget:?package=UtilBlast&version=2.0.0
UtilBlast ⚡
UtilBlast is a lightweight utility + abstractions library for .NET.
It bundles extensions, interfaces, and a Factory for quick bootstrapping with dependency injection (DI) — designed to work in apps, LINQPad, and PowerShell.
✨ Features
Extensions
DateTimehelpers (start/end of day, working days, unix time, etc.)Stringhelpers (PascalCase, CamelCase, SnakeCase, etc.)Mathhelpers (Add, Multiply, Clamp, Factorial, etc.)DataTableformatting (Dump(), RFC 4180ToCsv()/ParseCsvToDataTable(), filtering, sorting, distinct rows)IEnumerable<T>.ToCsv()— reflect properties, write CSV in one line (new in 1.1)Json⇆Csvbridge (JsonToCsv(),CsvToJson()) — auto-flattens nested objects + arrays (new in 1.1)JObject.Flatten()andJToken.GetByPath("a.b[0].c")for nested-JSON ergonomics (new in 1.1)Json(pretty-print, serialize/deserialize with Newtonsoft)Markdown(parse YAML metadata frontmatter)Guid⇆byte[]conversionsExpandoObject.Dump()for debugging
Interfaces
IFileHelper– file and directory utilities (read, write, zip, cleanup)ILocalStorage– in-memory key/value store with TTL, regex queries, persistenceISqlGenerator– simple SQL (SELECT/INSERT/UPDATE/DELETE) + parameter mappingIBlastLogger– logging abstraction (default adapter wrapsILogger<T>)
Note: UtilBlast 2.0 no longer ships
IDynamicClassBuilder/IDynamicClassGenerator. For runtime class generation use the AssemblyBlast sibling package directly.Factory 🔥
UtilBlastFactory.Create()→ get a ready-to-use DI containerUtilBlastFactory.Get<T>()→ one-liner to resolve a service- Built-in console logging option, or plug in your own
IBlastLogger
🚀 Install
dotnet add package UtilBlast
🖥 Usage
In a .NET app
using Microsoft.Extensions.DependencyInjection;
using UtilBlast;
using UtilBlast.Interfaces;
var services = new ServiceCollection()
.AddLogging(b => b.AddConsole())
.AddUtilBlast();
var provider = services.BuildServiceProvider();
var files = provider.GetRequiredService<IFileHelper>();
files.WriteFile("test.txt", "Hello, UtilBlast!");
In LINQPad
// Press F4 -> Add NuGet -> UtilBlast + Microsoft.Extensions.Logging.Console
var log = UtilBlast.UtilBlastFactory.Get<UtilBlast.Interfaces.IBlastLogger>();
log.Information("Hello from UtilBlast in LINQPad!");
var store = UtilBlast.UtilBlastFactory.Get<UtilBlast.Interfaces.ILocalStorage>();
store.SetData("user", "Alice");
store.ListAllData().Dump();
In PowerShell 7+
# Load assemblies (from NuGet install folder)
Add-Type -Path ".\lib\UtilBlast.dll"
Add-Type -Path ".\lib\Microsoft.Extensions.Logging.Console.dll"
# Create provider
$provider = [UtilBlast.UtilBlastFactory]::Create($true)
# Resolve and use services
$file = $provider.GetRequiredService([UtilBlast.Interfaces.IFileHelper])
$file.WriteFile("ps-demo.txt", "Hello from PowerShell")
⚙️ Dependency Injection
Register everything into your own IServiceCollection:
services.AddUtilBlast(opt =>
{
opt.DefaultLifetime = ServiceLifetime.Singleton;
// opt.LoggerFactory = sp => new MySerilogLogger(...);
});
📦 Why UtilBlast?
- One NuGet, many helpers
- Works in apps, scripts, and LINQPad with zero boilerplate
- Abstractions for clean testing (
IFileHelper,ILocalStorage, …) - Extensions to cut boilerplate in day-to-day code
- Plug-and-play DI setup with Factory
🤖 AI assistants
This assembly carries the Blast.PrimaryFacade convention: an
[AssemblyMetadata("Blast.PrimaryFacade", "...")] attribute names the
canonical front-door type(s) of the package, so AI helpers (e.g.
TaskBlaster's script assistant) can identify the entry points without
scanning every public type.
For UtilBlast the front doors are:
| Type | Purpose |
|---|---|
UtilBlast.Tabular.Blast |
The Blast display DSL: WriteHeading / WriteStatus / WriteKv / WriteTable. |
UtilBlast.UtilBlastFactory |
Bootstrapping helpers for DI / one-line use from scripts. |
Read it back from a loaded assembly via reflection:
var facade = typeof(UtilBlast.UtilBlastFactory).Assembly
.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(a => a.Key == "Blast.PrimaryFacade")?.Value;
The value is a hint for tooling; consumers don't need to read it.
📄 License
MIT © 2025 — Free to use and modify.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Logging (>= 10.0.7)
- Microsoft.Extensions.Logging.Console (>= 10.0.7)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.