CasCap.Common.Extensions
4.14.1
Prefix Reserved
dotnet add package CasCap.Common.Extensions --version 4.14.1
NuGet\Install-Package CasCap.Common.Extensions -Version 4.14.1
<PackageReference Include="CasCap.Common.Extensions" Version="4.14.1" />
<PackageVersion Include="CasCap.Common.Extensions" Version="4.14.1" />
<PackageReference Include="CasCap.Common.Extensions" />
paket add CasCap.Common.Extensions --version 4.14.1
#r "nuget: CasCap.Common.Extensions, 4.14.1"
#:package CasCap.Common.Extensions@4.14.1
#addin nuget:?package=CasCap.Common.Extensions&version=4.14.1
#tool nuget:?package=CasCap.Common.Extensions&version=4.14.1
CasCap.Common.Extensions
General-purpose extension methods and helper utilities for .NET applications.
Installation
dotnet add package CasCap.Common.Extensions
Purpose
Provides commonly-used extension methods for date/time, strings, enums, parsing, I/O, buffers, collections, and XML — used as a foundational utility library across the CasCap ecosystem.
Target frameworks: netstandard2.0, net8.0, net9.0, net10.0
Extensions
| Class | Key Methods |
|---|---|
DateTimeExtensions |
TruncateToHour(), TruncateToDay(), TruncateToMonth(), GetMissingDates(), FromUnixTime(), ToUnixTime(), IsWeekend(), AddWeekdays(), ToRelativeDateString() |
StringExtensions |
ToSnakeCase(), UrlCombine(), IsEmail(), MaskPhoneNumber(), MaskEndpoint(), NormalizeWhitespace(), Sanitize() |
HelperExtensions |
FromXml(), GetBatches(), ToConcurrentDictionary(), IsIntegration(), IsTest(), Compress(), Decompress() |
EnumExtensions |
GetAllItems(), GetAllCombinations(), ToStringCached(), GetDisplayName(), HasFlag() |
ParseExtensions |
GetDecimalCount(), CsvStr2Date(), CsvDate2Str(), Decimal2Int(), Decimal2Long() |
IOExtensions |
WriteAllBytes(), WriteAllTextAsync(), AppendTextFile() |
ShellExtensions |
RunProcess(), RunProcessDiagnostic(), RunProcessWithStdinAsync(), Bash() |
BufferExtensions |
TryReadLine() (NET8+) |
Exceptions
| Type | Description |
|---|---|
GenericException |
Generic catch-all exception type |
Models
| Type | Description |
|---|---|
FixedSizedQueue<T> |
Fixed-capacity ConcurrentQueue<T> that auto-dequeues oldest items when full |
ProcessResult |
Readonly record struct returned by RunProcessWithStdinAsync — Output, Error, ErrorLength, ExitCode, and Success |
ProcessErrorCapture |
Whether standard error is retained as Text or counted and discarded as Length |
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 CasCap.Common.Models;
var result = await ShellExtensions.RunProcessWithStdinAsync(
"ffmpeg",
["-i", "pipe:0", "-f", "wav", "-ar", "16000", "pipe:1"],
inputBytes,
ProcessErrorCapture.Length);
if (result.Success)
Use(result.Output);
Choose ProcessErrorCapture.Length when the diagnostics may echo third-party file names or other
content that should not be retained; the count still proves whether anything was written.
The overload taking a single arguments string is obsolete because it splits on spaces, so any
argument containing one arrives as several.
Dependencies
NuGet Packages
This project has no direct NuGet package references.
Project References
| Project | Purpose |
|---|---|
CasCap.Common.Logging |
ApplicationLogging static logger factory |
| 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.14.1)
-
net10.0
- CasCap.Common.Logging (>= 4.14.1)
-
net8.0
- CasCap.Common.Logging (>= 4.14.1)
-
net9.0
- CasCap.Common.Logging (>= 4.14.1)
NuGet packages (30)
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.14.1 | 0 | 9/23/2026 |
| 4.14.0 | 840 | 9/19/2026 |
| 4.13.0 | 272 | 9/15/2026 |
| 4.12.8 | 709 | 9/10/2026 |
| 4.12.7 | 597 | 9/4/2026 |
| 4.12.6 | 638 | 9/1/2026 |
| 4.12.5 | 532 | 8/20/2026 |
| 4.12.4 | 756 | 8/18/2026 |
| 4.12.3 | 969 | 7/15/2026 |
| 4.12.2 | 830 | 6/26/2026 |
| 4.12.1 | 531 | 6/14/2026 |
| 4.12.0 | 778 | 6/12/2026 |
| 4.11.9 | 710 | 6/10/2026 |
| 4.11.8 | 1,552 | 5/27/2026 |
| 4.11.7 | 346 | 5/27/2026 |
| 4.11.6 | 804 | 5/26/2026 |
| 4.11.5 | 360 | 5/22/2026 |
| 4.11.4 | 775 | 5/20/2026 |
| 4.11.3 | 920 | 5/13/2026 |
| 4.11.2 | 364 | 5/11/2026 |