Skip to content

Release 1.0.2

Latest

Choose a tag to compare

@dmitrymal dmitrymal released this 16 Mar 19:37
· 3 commits to master since this release
f33c265

Release notes:

Added Support for net8.0 and net9.0

.NET Common Extensions

A collection of simple but useful extensions to .NET basic objects

Setup:

Nuget

Available on NuGet: Companova.Common.Extensions

Example IsNullOrEmpty();

IsNullOrEmpty();

Replaces a common practice to check whether a List or Array is null or empty.

void foo(List<T> listOfTs)
{
    // Use the extension to check whether the List is null or empty.
    // Instead of this:
    if(listOfTs == null || listOfTs.Count == 0)
        return;

    // Use this:
    if(listOfTs.IsNullOrEmpty())
        return;
        
    // There is some data in the List. Continue on
}

Example Shuffle();

Shuffle();

Randomly Shuffles an Array:

{
    int[] arr = new int[100];
    for(int i = 0; i < arr.Length; i++)
    {
        arr[i] = i;
    }

    arr.Shuffle();
}

What's Changed

Full Changelog: 1.0.1...1.0.2