dotnet
dotnet copied to clipboard
Provide `Guard.IsNotNullOrEmpty` for collection types
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