CheapHelpers.Services
1.2.0
dotnet add package CheapHelpers.Services --version 1.2.0
NuGet\Install-Package CheapHelpers.Services -Version 1.2.0
<PackageReference Include="CheapHelpers.Services" Version="1.2.0" />
<PackageVersion Include="CheapHelpers.Services" Version="1.2.0" />
<PackageReference Include="CheapHelpers.Services" />
paket add CheapHelpers.Services --version 1.2.0
#r "nuget: CheapHelpers.Services, 1.2.0"
#:package CheapHelpers.Services@1.2.0
#addin nuget:?package=CheapHelpers.Services&version=1.2.0
#tool nuget:?package=CheapHelpers.Services&version=1.2.0
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>"
);
Geocoding Services
using CheapHelpers.Services.Geocoding.Extensions;
// Configure geocoding with multiple providers
services.AddGeocodingServices(options =>
{
options.DefaultProvider = GeocodingProvider.Mapbox;
options.Mapbox.AccessToken = "your-mapbox-token";
options.AzureMaps.SubscriptionKey = "your-azure-key";
options.GoogleMaps.ApiKey = "your-google-key";
options.PtvMaps.ApiKey = "your-ptv-key";
});
// Forward geocoding - address to coordinates
var result = await geocodingService.GeocodeAsync("1600 Amphitheatre Parkway, Mountain View, CA");
Console.WriteLine($"Coordinates: {result.Coordinate.Latitude}, {result.Coordinate.Longitude}");
// Reverse geocoding - coordinates to address
var address = await geocodingService.ReverseGeocodeAsync(37.4224764, -122.0842499);
Console.WriteLine($"Address: {address.FormattedAddress}");
// Fuzzy search/autocomplete
var results = await geocodingService.SearchAsync("main st", new GeocodingOptions
{
Limit = 5,
Countries = new[] { "US" }
});
Status Bar Configuration (MAUI)
// In MauiProgram.cs - ONE LINE configuration!
builder.UseMauiApp<App>()
.UseTransparentStatusBar(StatusBarStyle.DarkContent);
// Or from any page/code
StatusBarHelper.ConfigureForLightBackground(); // Dark icons for light theme
StatusBarHelper.ConfigureForDarkBackground(); // Light icons for dark theme
// Get status bar height for layouts
var height = StatusBarHelper.GetStatusBarHeight();
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);
}
Projects
This repository contains multiple NuGet packages, each with its own documentation:
CheapHelpers.Blazor
Blazor and Blazor Hybrid utilities including app bar components, WebView helpers, push notification abstractions, and file download utilities.
Key Features:
- App Bar Component with programmatic control
- Blazor Hybrid integration (MAUI, Photino, Avalonia)
- Push notification abstractions (platform-agnostic)
- WebView JSON parser and bridge
- Download helper and clipboard service
Documentation: CheapHelpers.Blazor/Docs
CheapHelpers.MAUI
MAUI platform helpers for iOS and Android including status bar configuration, system UI helpers, and push notification implementations.
Key Features:
- Cross-platform status bar configuration
- Android system bars (status bar + navigation bar) with edge-to-edge support
- iOS APNS and Android FCM push notification implementations
- Firebase token helper with safe retrieval
- Device installation service for backend registration
Documentation: CheapHelpers.MAUI/Docs
CheapHelpers
Core utilities, extensions, and helpers for everyday .NET development.
Key Features:
- String extensions (capitalize, sanitize, phone numbers, truncation)
- DateTime extensions (timezone conversion, business days, rounding)
- Collection extensions (dynamic ordering, replacements, bindings)
- Memory caching with flexible expiration strategies
- Encryption helpers (machine-specific AES-256)
- File helpers (secure filename generation, date-based naming)
- Process execution with progress tracking
Documentation: Docs/Core
CheapHelpers.EF
Entity Framework repository pattern and extensions.
Key Features:
- BaseRepo with CRUD operations and pagination
- Context extensions for bulk operations
- PaginatedList helper
Documentation: Docs/EF
CheapHelpers.Services
Business services and integrations for common development tasks.
Key Features:
- Email service with SMTP and Fluid templates
- Geocoding services with 4 providers (Mapbox, Azure Maps, Google Maps, PTV Maps)
- PDF generation and optimization services
- XML serialization (dynamic and strongly-typed)
- Azure integration (Translation, Vision, Document services)
Documentation: Docs/Services
CheapHelpers.Networking
Network scanning and device discovery utilities.
Key Features:
- Network scanner with background discovery
- Device detectors (UPnP, mDNS, HTTP, SSH)
- MAC address resolution (cross-platform)
Documentation: Docs/Networking
Architecture
See Docs/ARCHITECTURE.md for overall solution architecture and separation of concerns.
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.2.0)
- CheapHelpers.EF (>= 1.2.0)
- CheapHelpers.Models (>= 1.2.0)
- ClosedXML (>= 0.105.0)
- CsvHelper (>= 33.1.0)
- Duende.IdentityModel (>= 7.1.0)
- Fluid.Core (>= 2.31.0)
- GoogleApi (>= 5.8.11)
- ILove_PDF (>= 1.6.2)
- itext (>= 9.4.0)
- itext.pdfoptimizer (>= 4.1.1)
- MailKit (>= 4.14.1)
- Microsoft.AspNetCore.Http.Connections (>= 1.2.0)
- Microsoft.AspNetCore.SignalR.Client (>= 10.0.0)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- Microsoft.Graph (>= 5.96.0)
- SixLabors.ImageSharp (>= 3.1.12)
- Twilio (>= 7.13.6)
- UblSharp (>= 1.1.1)
- ZXing.Net (>= 0.16.11)
- ZXing.Net.Bindings.ImageSharp.V3 (>= 0.16.18)
NuGet packages (2)
Showing the top 2 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) |
|
|
CheapHelpers.Avalonia.Bridge
Bridge package integrating CheapAvaloniaBlazor desktop notifications with CheapHelpers notification system. Provides DesktopNotificationChannel adapter allowing desktop OS notifications to participate in the unified notification system. |
GitHub repositories
This package is not used by any popular GitHub repositories.