CasCap.Common.Extensions
4.16.0
Prefix Reserved
dotnet add package CasCap.Common.Extensions --version 4.16.0
NuGet\Install-Package CasCap.Common.Extensions -Version 4.16.0
<PackageReference Include="CasCap.Common.Extensions" Version="4.16.0" />
<PackageVersion Include="CasCap.Common.Extensions" Version="4.16.0" />
<PackageReference Include="CasCap.Common.Extensions" />
paket add CasCap.Common.Extensions --version 4.16.0
#r "nuget: CasCap.Common.Extensions, 4.16.0"
#:package CasCap.Common.Extensions@4.16.0
#addin nuget:?package=CasCap.Common.Extensions&version=4.16.0
#tool nuget:?package=CasCap.Common.Extensions&version=4.16.0
CasCap.Common.Extensions
General-purpose extension methods and helper utilities for .NET applications.
Installation
dotnet add package CasCap.Common.Extensions
Target frameworks: netstandard2.0, net8.0, net9.0, net10.0
Usage
using System;
using CasCap.Common.Extensions;
var columnName = "OrderTotal".ToSnakeCase();
var endpoint = "https://example.com/api/".UrlCombine("/items");
Console.WriteLine(columnName); // order_total
Console.WriteLine(endpoint); // https://example.com/api/items
Available Helpers
| Class | Key Methods |
|---|---|
DateTimeExtensions |
Date truncation, Unix time, missing dates and weekday calculations |
StringExtensions |
Case conversion, URL combination, validation, masking and whitespace normalization |
HelperExtensions |
Collections, XML, byte conversion and compression |
EnumExtensions |
Enum enumeration, parsing, cached names and display names |
ParseExtensions |
Numeric conversions and CSV date parsing |
IOExtensions |
File creation, writing and appending |
ShellExtensions |
Process execution, binary stdin/stdout and Linux Bash commands |
BufferExtensions |
TryReadLine() for sequence buffers; .NET 8+ only |
FixedSizedQueue<T> provides a fixed-capacity concurrent queue that evicts the oldest items.
Piping Binary Data Through a Process
RunProcessWithStdinAsync writes bytes to a child process and reads its standard output back, which
suits in-memory media transcoding without temporary files. Both output streams are drained while the
input is written, so a payload larger than the pipe buffer cannot deadlock, and the process is killed
along with its children whenever the method stops waiting on it.
Pass each argument as its own array element; nothing is quoted or escaped on the way through:
using System;
using CasCap.Common.Extensions;
using CasCap.Common.Models;
var result = await ShellExtensions.RunProcessWithStdinAsync(
"ffmpeg",
["-i", "pipe:0", "-f", "wav", "-ar", "16000", "pipe:1"],
inputBytes,
ProcessErrorCapture.Length);
if (!result.Success)
throw new InvalidOperationException($"Transcoding failed with exit code {result.ExitCode}.");
byte[] audioBytes = result.Output;
The example assumes inputBytes contains the media to convert and ffmpeg is installed. Choose
ProcessErrorCapture.Length when diagnostics may contain third-party content: Error is discarded,
while ErrorLength records its length. ProcessErrorCapture.Text retains the diagnostic string.
ProcessResult.Success reflects the exit code; cancellation propagates to the caller.
Bash() is supported only on Linux. Other process helpers require the named executable on the host.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- CasCap.Common.Logging (>= 4.16.0)
-
net10.0
- CasCap.Common.Logging (>= 4.16.0)
-
net8.0
- CasCap.Common.Logging (>= 4.16.0)
-
net9.0
- CasCap.Common.Logging (>= 4.16.0)
NuGet packages (32)
Showing the top 5 NuGet packages that depend on CasCap.Common.Extensions:
| Package | Downloads |
|---|---|
|
CasCap.Common.Serialisation.Json
Helper library for common Json serialisation requirements. |
|
|
CasCap.Common.Caching
Helper library for local and remote object caching. |
|
|
CasCap.Common.Serialization.Json
System.Text.Json serialization helpers and custom JsonConverter implementations. |
|
|
CasCap.Common.Extensions.Diagnostics.HealthChecks
Custom ASP.NET Core health check base classes for monitoring HTTP endpoint availability. |
|
|
CasCap.Apis.AzureDevOps
Azure DevOps helper/utility library. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.16.0 | 280 | 10/21/2026 |
| 4.15.0 | 386 | 10/6/2026 |
| 4.14.4 | 661 | 10/4/2026 |
| 4.14.3 | 334 | 9/28/2026 |
| 4.14.2 | 669 | 9/25/2026 |
| 4.14.1 | 725 | 9/23/2026 |
| 4.14.0 | 1,174 | 9/19/2026 |
| 4.13.0 | 302 | 9/15/2026 |
| 4.12.8 | 730 | 9/10/2026 |
| 4.12.7 | 619 | 9/4/2026 |
| 4.12.6 | 814 | 9/1/2026 |
| 4.12.5 | 548 | 8/20/2026 |
| 4.12.4 | 771 | 8/18/2026 |
| 4.12.3 | 984 | 7/15/2026 |
| 4.12.2 | 848 | 6/26/2026 |
| 4.12.1 | 547 | 6/14/2026 |
| 4.12.0 | 795 | 6/12/2026 |
| 4.11.9 | 725 | 6/10/2026 |
| 4.11.8 | 1,580 | 5/27/2026 |
| 4.11.7 | 363 | 5/27/2026 |