Network scanning, device discovery, and IoT device management with cross-platform support. Includes UPnP/SSDP, mDNS/Zeroconf, HTTP, SSH, and Windows service detection.
$ dotnet add package CheapHelpers.NetworkingA 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.
| 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) | |
| CheapHelpers.MediaProcessing | FFmpeg integration, hardware detection (Windows/Linux) | |
| CheapHelpers.Avalonia.Bridge | Desktop notification bridge for Avalonia apps |
# 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
# Media processing (FFmpeg, hardware detection)
dotnet add package CheapHelpers.MediaProcessing
# Avalonia desktop notifications bridge
dotnet add package CheapHelpers.Avalonia.Bridge
using CheapHelpers.Extensions;
"hello world".Capitalize(); // "Hello world"
"0474123456".ToInternationalPhoneNumber("BE"); // "+32474123456"
"Very long text...".ToShortString(10); // "Very lo..."
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));
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);
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}");
};
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>"
);
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" }
});
// 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();
// 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);
}
This repository contains multiple NuGet packages, each with its own documentation:
Blazor and Blazor Hybrid utilities including app bar components, WebView helpers, push notification abstractions, and file download utilities.
Key Features:
Documentation: CheapHelpers.Blazor/Docs
MAUI platform helpers for iOS and Android including status bar configuration, system UI helpers, and push notification implementations.
Key Features:
Documentation: CheapHelpers.MAUI/Docs
Core utilities, extensions, and helpers for everyday .NET development.
Key Features:
Documentation: Docs/Core
Entity Framework repository pattern and extensions.
Key Features:
Documentation: Docs/EF
Business services and integrations for common development tasks.
Key Features:
Documentation: Docs/Services
Network scanning and device discovery utilities.
Key Features:
Documentation: Docs/Networking
Media processing utilities for FFmpeg integration and hardware detection.
Platform Support:
Key Features:
Usage:
// Automatic platform detection
services.AddMediaProcessing();
// Or explicit platform selection
services.AddMediaProcessingWindows(); // Windows only
services.AddMediaProcessingLinux(); // Linux only
Bridge package integrating CheapAvaloniaBlazor desktop notifications with CheapHelpers notification system.
Key Features:
See Docs/ARCHITECTURE.md for overall solution architecture and separation of concerns.
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
This project is licensed under the MIT License - see the LICENSE.txt file for details.