dotnet icon indicating copy to clipboard operation
dotnet copied to clipboard

Provide `Guard.IsNotNullOrEmpty` for collection types

Open cremor opened this issue 2 years ago • 0 comments

Overview

Guard provides IsNotEmpty overloads for many collection types. It should also provide IsNotNullOrEmpty overloads.

API breakdown

public static class Guard
{
    public static void IsNotNullOrEmpty<T>(ICollection<T> collection, [CallerArgumentExpression("collection")] string name = "");
    // Also other overloads like already exist for 'IsNotEmpty'.
}

Usage example

Guard.IsNotNullOrEmpty(myCollection);

Breaking change?

No

Alternatives

Guard.IsNotNull(myCollection);
Guard.IsNotEmpty(myCollection);

Additional context

No response

Help us help you

No, just wanted to propose this

cremor avatar Jul 19 '23 07:07 cremor