/Aoxe.Extensions

Extensions for C#

Primary LanguageC#MIT LicenseMIT

Aoxe.Extensions

License: MIT Stars Forks


Aoxe.Extensions is a powerful C# library that provides a rich set of extension methods to enhance your development experience and boost productivity. Our goal is to simplify common programming tasks and make your code more readable and maintainable.

๐Ÿš€ Features

  • ๐Ÿงฉ Extensive collection of extension methods for built-in C# types
  • ๐ŸŽฏ Designed to reduce boilerplate code and improve readability
  • ๐Ÿ”ง Easy to use with a fluent API design
  • ๐Ÿ“š Comprehensive documentation and examples
  • โšก High-performance implementations
  • ๐Ÿ”’ Thread-safe operations where applicable
  • ๐Ÿงช Thoroughly tested with high code coverage

๐Ÿ“ฆ Installation

Install Aoxe.Extensions via Clr:

PM> Install-Package Aoxe.Extensions

๐Ÿ”ง Usage

To use Aoxe.Extensions in your project, add the following using statement:

using Aoxe.Extensions;

๐ŸŒŸ Examples

Aoxe.Extensiosn is based on the idea of fluent style, providing a huge number of extension methods to extend C#, thus making the C# language more readable.

// Exception handling
try
{
    throw new InvalidOperationException("Outer", 
        new ArgumentException("Inner", 
            new NullReferenceException("Inmost")));
}
catch (Exception ex)
{
    var inmostException = ex.GetInmostException();
    Console.WriteLine($"Inmost exception message: {inmostException.Message}");
    // Output: Inmost exception message: Inmost
}

// String extensions
string text = "Hello, World!";
Console.WriteLine(text.IsNullOrEmpty());  // False
Console.WriteLine(text.Truncate(5));      // "Hello..."

// Collection extensions
var numbers = new List<int> { 1, 2, 3, 4, 5 };
Console.WriteLine(numbers.IsNullOrEmpty());  // False
var evenNumbers = numbers.Where(n => n % 2 == 0);
Console.WriteLine(string.Join(", ", evenNumbers));  // 2, 4

// DateTime extensions
var date = DateTime.UtcNow;
Console.WriteLine(date.ToUnixTimeSeconds());

// Enum extensions
public enum Color { Red, Green, Blue }
var color = Color.Red;
Console.WriteLine(color.GetDescription());

// Numeric extensions
int number = 42;
Console.WriteLine(number.IsEven());  // True

These examples showcase potential usage of extension methods that might be included in the Aoxe.Extensions library. The actual implementation and available methods may vary, so it's recommended to refer to the official documentation or source code for accurate usage information.

[Source: https://github.com/AoxeTech/Aoxe.Extensions]


Thank`s for JetBrains for the great support in providing assistance and user-friendly environment for my open source projects.

JetBrains