CheapHelpers.Services 1.2.0

dotnet add package CheapHelpers.Services --version 1.2.0
                    
NuGet\Install-Package CheapHelpers.Services -Version 1.2.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="CheapHelpers.Services" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CheapHelpers.Services" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="CheapHelpers.Services" />
                    
Project file
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 CheapHelpers.Services --version 1.2.0
                    
#r "nuget: CheapHelpers.Services, 1.2.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 CheapHelpers.Services@1.2.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=CheapHelpers.Services&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=CheapHelpers.Services&version=1.2.0
                    
Install as a Cake Tool

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 NuGet Core utilities, extensions, and helpers
CheapHelpers.Models NuGet Shared data models and DTOs
CheapHelpers.EF NuGet Entity Framework repository pattern
CheapHelpers.Services NuGet Business services and integrations
CheapHelpers.Blazor NuGet Blazor components, UI utilities, and Hybrid features
CheapHelpers.Networking NuGet Network scanning and device discovery
CheapHelpers.MAUI NuGet 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.2.0 70 1/10/2026
1.1.4 287 11/4/2025
1.1.3 212 11/3/2025
1.1.2 151 11/1/2025
1.0.0 153 11/1/2025