ImanSoftware.Extensions 1.0.4

dotnet add package ImanSoftware.Extensions --version 1.0.4
                    
NuGet\Install-Package ImanSoftware.Extensions -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ImanSoftware.Extensions" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ImanSoftware.Extensions" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="ImanSoftware.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ImanSoftware.Extensions --version 1.0.4
                    
#r "nuget: ImanSoftware.Extensions, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ImanSoftware.Extensions@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ImanSoftware.Extensions&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=ImanSoftware.Extensions&version=1.0.4
                    
Install as a Cake Tool

ImanSoftware.Extensions

Version: 1.0.1 | Last Updated: August 2026

A lightweight collection of useful .NET extension methods that reduce boilerplate code and simplify everyday development.

ImanSoftware.Extensions provides a rich set of extension methods for the most commonly used .NET types, making your code cleaner, more expressive, and easier to maintain.


Installation

Install the package using the .NET CLI:

dotnet add package ImanSoftware.Extensions

Why ImanSoftware.Extensions?

Every .NET project ends up implementing the same helper methods over and over again.

This package centralizes those common extensions into a single, dependency-free library.

Benefits include:

  • Less repetitive code
  • Improved readability
  • Cleaner APIs
  • Consistent helper methods across projects
  • Lightweight and easy to use

Features

String Extensions

Useful helpers for working with strings.

Available methods:

  • ToCamelCase()
  • ToSnakeCase()
  • Truncate()
  • IsEmail()
  • ExtractNumbers()
  • NormalizeWhitespace()
  • IsNullOrWhiteSpace()

Example:

using ImanSoftware.Extensions;

var text = "  hello    world  ";

var normalized = text.NormalizeWhitespace();
// hello world

var camel = text.ToCamelCase();
// helloWorld

var snake = text.ToSnakeCase();
// hello_world

var numbers = "Phone: +1 (234) 567-890".ExtractNumbers();
// 1234567890

DateTime Extensions

Utility methods for working with dates and times.

Available methods:

  • StartOfDay()
  • EndOfDay()
  • StartOfWeek()
  • Age()
  • IsToday()
  • ToUnixTimestamp()
  • FromUnixTimestamp()

Example:

using ImanSoftware.Extensions;

var now = DateTime.Now;

var start = now.StartOfDay();
var end = now.EndOfDay();
var week = now.StartOfWeek();

var age = birthDate.Age();

bool isToday = now.IsToday();

long unix = now.ToUnixTimestamp();

DateTime date = DateTimeExtensions.FromUnixTimestamp(unix);

Enum Extensions

Additional functionality for enumerations.

Available methods:

  • GetDescription()
  • GetDisplayName()
  • GetValues()
  • ToInt()
  • Parse()

Example:

var description = OrderStatus.Completed.GetDescription();

int value = OrderStatus.Completed.ToInt();

var status = EnumExtensions.Parse<OrderStatus>("Completed");

Enumerable Extensions

Helpful extensions for collections.

Available methods:

  • IsNullOrEmpty()
  • DistinctBy()
  • Chunk()
  • ForEach()
  • ToHashSet()

Example:

var users = repository.GetUsers();

if (!users.IsNullOrEmpty())
{
    users.ForEach(Console.WriteLine);
}

var unique = users.DistinctBy(x => x.Id);

var groups = users.Chunk(10);

var hashSet = users.ToHashSet();

Object Extensions

General-purpose object helpers.

Available methods:

  • ToJson()
  • IsNull()
  • ThrowIfNull()
  • DeepCopy()

Example:

var json = user.ToJson();

user.ThrowIfNull();

var clone = user.DeepCopy();

bool isNull = user.IsNull();

Exception Extensions

Utilities for working with exceptions.

Available methods:

  • GetFullMessage()
  • GetFullStackTrace()
  • Is<T>()
  • GetInnermostException()

Example:

try
{
    // Code...
}
catch (Exception ex)
{
    Console.WriteLine(ex.GetFullMessage());

    Console.WriteLine(ex.GetFullStackTrace());

    if (ex.Is<ArgumentException>())
    {
        // Handle argument exception
    }

    var inner = ex.GetInnermostException();
}

Example

using ImanSoftware.Extensions;

var name = "  hello world  ";

var normalized = name.NormalizeWhitespace();
// hello world

var camel = name.ToCamelCase();
// helloWorld

var snake = name.ToSnakeCase();
// hello_world

var date = DateTime.Now;

var startOfWeek = date.StartOfWeek();

var age = birthDate.Age();

long unix = date.ToUnixTimestamp();

Design Goals

  • Lightweight
  • Dependency-free
  • High performance
  • Simple API
  • Clean and consistent naming
  • Everyday developer utilities
  • Compatible with modern .NET applications

Requirements

  • .NET Standard 2.0+
  • .NET 6+
  • .NET 7+
  • .NET 8+
  • .NET 9+
  • .NET 10.0+

Author

Iman Estiri

📧 contact.imanestiri@gmail.com

📧 dev.imanestiri@gmail.com

GitHub:

https://github.com/ImanEstiri


License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ImanSoftware.Extensions:

Package Downloads
ImanSoftware.RateLimiter

Rate limiting abstraction with in-memory and distributed support.

ImanSoftware.Framework

Umbrella package that bundles all ImanSoftware modules for a unified development experience.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 84 9/9/2026
1.0.3 109 9/9/2026
1.0.2 113 9/9/2026
1.0.1 129 8/13/2026
1.0.0 116 8/3/2026