![]() |
VOOZH | about |
dotnet add package Atc --version 3.0.173
NuGet\Install-Package Atc -Version 3.0.173
<PackageReference Include="Atc" Version="3.0.173" />
<PackageVersion Include="Atc" Version="3.0.173" />Directory.Packages.props
<PackageReference Include="Atc" />Project file
paket add Atc --version 3.0.173
#r "nuget: Atc, 3.0.173"
#:package Atc@3.0.173
#addin nuget:?package=Atc&version=3.0.173Install as a Cake Addin
#tool nuget:?package=Atc&version=3.0.173Install as a Cake Tool
Target Frameworks: netstandard2.0, net9.0, net10.0
The foundation library for .NET development, providing a comprehensive collection of common utilities, extension methods, and helpers. Multi-targeting ensures compatibility with a wide range of .NET applications, from .NET Framework 4.7.2+ to the latest .NET versions.
Atc eliminates boilerplate code and provides battle-tested implementations for common tasks. Instead of writing the same utility code in every project, Atc provides:
Perfect for:
dotnet add package Atc
The library multi-targets to provide broad compatibility with:
Organized by category:
ILogger extensions for structured loggingLogKeyValueItem for key-value pair loggingLogItemFactory for creating log itemsMathEx: Extended math operationsNetworkInformationHelper: Network connectivity and IP address utilitiesJsonSerializerOptionsFactory: Preconfigured JSON serialization optionsLocalized resources for:
ILogger exampleslogger.LogKeyValueItems(..) // Collect data
var logItems = new List<LogKeyValueItem>
{
new LogKeyValueItem(LogCategoryType.Error, "Key1", "Error1"),
new LogKeyValueItem(LogCategoryType.Warning, "Key2", "Warning1"),
new LogKeyValueItem(LogCategoryType.Information, "Key3", "Information1"),
LogItemFactory.CreateError("Key4", "Error2"),
LogItemFactory.CreateWarning("Key5", "Warning2"),
LogItemFactory.CreateInformation("Key6", "Information2"),
};
// Log data
logger.LogKeyValueItems(logItems);
logger.LogKeyValueItem(..) // Collect data
var logItem = LogItemFactory.CreateError("Key1", "Error1");
// Log data
logger.LogKeyValueItem(LogItemFactory.CreateError(logItem));
TimeSpanExtensions examplesGetPrettyTime() or GetPrettyTime(decimalPrecision)The default value for decimalPrecision is 3.
var stopwatch = Stopwatch.StartNew();
DoSomthingThatTakesLongTime();
stopwatch.Stop();
Console.WriteLine($"Running time: {stopwatch.Elapsed.GetPrettyTime()}");
Result format could look like:
Running time: 14,015 sec
Running time: 13,234 min
Running time: 12,213 hours
NetworkInformationHelper examplesHasConnection()This helper method ask a external internet service (GoogleDNS ping), to see it there is connection.
bool hasConnection = NetworkInformationHelper.HasConnection()
GetPublicIpAddress()This helper method ask a external internet service (ipify.org), to get the external ip address.
IPAddress? ipAddress = NetworkInformationHelper.GetPublicIpAddress()
EnsureFirstCharacterToUpper()string result = "hello world".EnsureFirstCharacterToUpper();
// Result: "Hello world"
IsDigit(), IsNumeric(), and Validation Extensionsbool isDigit = "12345".IsDigit(); // true
bool isNumeric = "123.45".IsNumeric(); // true
bool isEmail = "user@example.com".IsEmailAddress(); // true
bool isGuid = "550e8400-e29b-41d4-a716-446655440000".IsGuid(); // true
Truncate()string longText = "This is a very long text that needs truncation";
string short = longText.Truncate(20);
// Result: "This is a very lo..."
ToTitleCase() and ToPascalCase()string title = "hello world".ToTitleCase(); // "Hello World"
string pascal = "hello world".ToPascalCase(); // "HelloWorld"
string camel = "HelloWorld".ToCamelCase(); // "helloWorld"
GetName() and GetDescription()public enum Status
{
[Description("Currently Active")]
Active,
[Description("Temporarily Inactive")]
Inactive
}
Status status = Status.Active;
string name = status.GetName(); // "Active"
string description = status.GetDescription(); // "Currently Active"
GetEnumValue<T>()Status status = EnumExtensions.GetEnumValue<Status>("Active");
// Result: Status.Active
// With description
Status statusFromDescription = EnumExtensions.GetEnumValueFromDescription<Status>("Currently Active");
// Result: Status.Active
AddIfNotContains()var list = new List<string> { "apple", "banana" };
list.AddIfNotContains("orange"); // Adds "orange"
list.AddIfNotContains("apple"); // Does nothing, already exists
ForEach()var numbers = new List<int> { 1, 2, 3, 4, 5 };
numbers.ForEach(n => Console.WriteLine(n * 2));
IsNullOrEmpty()List<string>? list = null;
bool isEmpty = list.IsNullOrEmpty(); // true
list = new List<string>();
isEmpty = list.IsNullOrEmpty(); // true
list.Add("item");
isEmpty = list.IsNullOrEmpty(); // false
GetAge()DateTime birthDate = new DateTime(1990, 5, 15);
int age = birthDate.GetAge(); // Current age in years
GetPrettyTimeDiff()DateTime past = DateTime.Now.AddMinutes(-45);
string diff = past.GetPrettyTimeDiff();
// Result: "45 minutes ago"
IsBetween()DateTime now = DateTime.Now;
DateTime start = DateTime.Now.AddHours(-1);
DateTime end = DateTime.Now.AddHours(1);
bool isBetween = now.IsBetween(start, end); // true
JsonSerializerOptionsFactoryusing Atc.Serialization;
// Create default options
var options = JsonSerializerOptionsFactory.Create();
// Serialize with camelCase
var json = JsonSerializer.Serialize(myObject, options);
// Deserialize
var obj = JsonSerializer.Deserialize<MyType>(json, options);
using Atc.Math.GeoSpatial;
var coordinate1 = new CartesianCoordinate(55.6761, 12.5683); // Copenhagen
var coordinate2 = new CartesianCoordinate(51.5074, -0.1278); // London
// Calculate distance in kilometers
double distance = coordinate1.DistanceTo(coordinate2);
Contributions are welcome! Please see the main for contribution guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Atc:
| Package | Downloads |
|---|---|
|
Atc.Rest
Atc.Rest is a basic collection of classes and extension methods for ASP.NET Core WebApi. |
|
|
Atc.CodeDocumentation
Atc.CodeDocumentation is a markdown generator for source code. |
|
|
Atc.OpenApi
Atc.OpenApi is a collection of classes and extension methods for Microsoft.OpenApi. |
|
|
Atc.XUnit
Atc.XUnit is a collection of helper method for code compliance of documentation and tests. |
|
|
Atc.Rest.ApiGenerator
Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.174 | 184 | 6/24/2026 |
| 3.0.173 | 117 | 6/24/2026 |
| 3.0.172 | 105 | 6/24/2026 |
| 3.0.67 | 3,134 | 4/25/2026 |
| 3.0.46 | 1,101 | 4/15/2026 |
| 3.0.45 | 549 | 4/10/2026 |
| 3.0.44 | 1,129 | 4/9/2026 |
| 3.0.43 | 236 | 4/9/2026 |
| 3.0.41 | 301 | 4/9/2026 |
| 3.0.40 | 273 | 4/9/2026 |
| 3.0.18 | 4,891 | 2/9/2026 |
| 3.0.16 | 5,956 | 12/15/2025 |
| 3.0.12 | 510 | 11/28/2025 |
| 3.0.9 | 754 | 11/21/2025 |
| 3.0.8 | 3,790 | 11/14/2025 |
| 3.0.4 | 2,296 | 11/6/2025 |
| 2.0.562 | 6,683 | 9/4/2025 |
| 2.0.561 | 446 | 9/4/2025 |
| 2.0.560 | 461 | 9/3/2025 |
| 2.0.558 | 615 | 8/22/2025 |