CheapHelpers.Services
1.1.4
dotnet add package CheapHelpers.Services --version 1.1.4
NuGet\Install-Package CheapHelpers.Services -Version 1.1.4
<PackageReference Include="CheapHelpers.Services" Version="1.1.4" />
<PackageVersion Include="CheapHelpers.Services" Version="1.1.4" />
<PackageReference Include="CheapHelpers.Services" />
paket add CheapHelpers.Services --version 1.1.4
#r "nuget: CheapHelpers.Services, 1.1.4"
#:package CheapHelpers.Services@1.1.4
#addin nuget:?package=CheapHelpers.Services&version=1.1.4
#tool nuget:?package=CheapHelpers.Services&version=1.1.4
CheapHelpers
A collection of production-ready C# utilities, extensions, and services for .NET 10.0 development. Simplify common development tasks with battle-tested helpers for Blazor, Entity Framework, networking, email, PDF generation, and more.
Packages
| Package | Version | Description |
|---|---|---|
| CheapHelpers | Core utilities, extensions, and helpers | |
| CheapHelpers.Models | Shared data models and DTOs | |
| CheapHelpers.EF | Entity Framework repository pattern | |
| CheapHelpers.Services | Business services and integrations | |
| CheapHelpers.Blazor | Blazor components, UI utilities, and Hybrid features | |
| CheapHelpers.Networking | Network scanning and device discovery | |
| CheapHelpers.MAUI | MAUI platform implementations (iOS APNS, Android FCM) |
Installation
# Core utilities and extensions
dotnet add package CheapHelpers
# Entity Framework repository pattern
dotnet add package CheapHelpers.EF
# Business services (email, PDF, Azure)
dotnet add package CheapHelpers.Services
# Blazor components and Hybrid features
dotnet add package CheapHelpers.Blazor
# Network scanning and device discovery
dotnet add package CheapHelpers.Networking
# MAUI platform implementations
dotnet add package CheapHelpers.MAUI
Quick Start
String Extensions
using CheapHelpers.Extensions;
"hello world".Capitalize(); // "Hello world"
"0474123456".ToInternationalPhoneNumber("BE"); // "+32474123456"
"Very long text...".ToShortString(10); // "Very lo..."
Memory Caching
using CheapHelpers.Caching;
// Sliding expiration - items expire after 30 minutes of inactivity
using var cache = new SlidingExpirationCache<User>("UserCache", TimeSpan.FromMinutes(30));
var user = await cache.GetOrAddAsync("user:123", async key => await database.GetUserAsync(key));
Entity Framework Repository
using CheapHelpers.EF.Repositories;
public class ProductRepo : BaseRepo<Product, MyDbContext>
{
public ProductRepo(MyDbContext context) : base(context) { }
}
var products = await productRepo.GetAllPaginatedAsync(pageIndex: 1, pageSize: 20);
Network Scanning
using CheapHelpers.Networking.Extensions;
services.AddNetworkScanning()
.AddAllDetectors() // UPnP, mDNS, HTTP, SSH, Windows Services
.AddJsonStorage();
var scanner = serviceProvider.GetRequiredService<INetworkScanner>();
scanner.Start(); // Background scanning
scanner.DeviceDiscovered += (device) =>
{
Console.WriteLine($"Found: {device.Name} ({device.IPv4Address}) - {device.Type}");
};
Email with Templates
using CheapHelpers.Services.Email;
services.AddEmailService(options =>
{
options.SmtpServer = "smtp.gmail.com";
options.SmtpPort = 587;
});
await emailService.SendEmailAsync(
recipient: "user@example.com",
subject: "Welcome!",
body: "<h1>Welcome to our app!</h1>"
);
Blazor Hybrid Push Notifications (MAUI)
// In MauiProgram.cs
builder.Services.AddBlazorHybridPushNotifications();
builder.Services.AddMauiPushNotifications(); // iOS APNS + Android FCM
// In your Blazor component
var status = await RegistrationManager.CheckDeviceStatusAsync(userId);
if (status == DeviceRegistrationState.NotRegistered)
{
await RegistrationManager.RegisterDeviceAsync(userId);
}
Documentation
Detailed documentation for each package:
Core Package
- String Extensions - Capitalize, sanitize, phone numbers, truncation
- DateTime Extensions - Timezone conversion, business days, rounding
- Collection Extensions - Dynamic ordering, replacements, bindings
- Caching - Memory cache with flexible expiration strategies
- Encryption - Machine-specific AES-256 encryption
- File Helpers - Secure filename generation, date-based naming
- Process Execution - Process executor with progress tracking
Entity Framework
- Repository Pattern - BaseRepo with CRUD operations and pagination
- Context Extensions - Bulk operations and utilities
Services
- Email Service - SMTP with Fluid templates and attachments
- PDF Services - PDF generation and optimization
- XML Service - Dynamic and strongly-typed serialization
- Azure Integration - Translation, Vision, Document services
Blazor
- Components - UI components and utilities
- Hybrid Features - WebView bridge and push notification abstractions
- Download Helper - Client-side file downloads
- Clipboard Service - Async clipboard operations
Networking
- Network Scanner - Device discovery and scanning
- Device Detectors - UPnP, mDNS, HTTP, SSH detection
- MAC Address Resolution - Cross-platform MAC lookup
MAUI
- Push Notifications - iOS APNS and Android FCM setup
- Device Installation - Device registration and management
- Local Notifications - Foreground notification display
Requirements
- .NET 10.0 or later
- C# 14.0 or later
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
git clone https://github.com/CheapNud/CheapHelpers.git
cd CheapHelpers
dotnet restore
dotnet build
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
| 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
- Azure.AI.Translation.Document (>= 2.0.0)
- Azure.AI.Vision.ImageAnalysis (>= 1.0.0)
- Azure.Identity (>= 1.17.0)
- Azure.Storage.Blobs (>= 12.26.0)
- CheapHelpers (>= 1.1.4)
- CheapHelpers.Models (>= 1.1.4)
- ClosedXML (>= 0.105.0)
- CsvHelper (>= 33.1.0)
- Duende.IdentityModel (>= 7.1.0)
- Fluid.Core (>= 2.30.0)
- ILove_PDF (>= 1.6.2)
- itext (>= 9.3.0)
- itext.pdfoptimizer (>= 4.1.0)
- MailKit (>= 4.14.1)
- Microsoft.AspNetCore.Http.Connections (>= 1.2.0)
- Microsoft.AspNetCore.SignalR.Client (>= 9.0.10)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Caching.Memory (>= 9.0.10)
- Microsoft.Graph (>= 5.95.0)
- SixLabors.ImageSharp (>= 3.1.12)
- Twilio (>= 7.13.5)
- UblSharp (>= 1.1.1)
- ZXing.Net (>= 0.16.11)
- ZXing.Net.Bindings.ImageSharp.V3 (>= 0.16.18)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CheapHelpers.Services:
| Package | Downloads |
|---|---|
|
CheapHelpers.Blazor
Blazor Server components, services, and utilities with MudBlazor integration, authentication support, and Blazor Hybrid features (WebView bridge, push notifications for MAUI/Photino/Avalonia) |
GitHub repositories
This package is not used by any popular GitHub repositories.