feat: Array.IsNotNullAndNotEmpty

This commit is contained in:
Mira 2023-12-25 00:05:06 +01:00
parent b59f83991e
commit bf89a30ef7
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36

View file

@ -37,4 +37,8 @@ public static class ListExtensions
/// <returns>Whether the list contains elements and is not null</returns> /// <returns>Whether the list contains elements and is not null</returns>
public static bool IsNotNullAndNotEmpty<T>(this IEnumerable<T>? obj) public static bool IsNotNullAndNotEmpty<T>(this IEnumerable<T>? obj)
=> obj is not null && obj.Any(); => obj is not null && obj.Any();
/// <inheritdoc cref="ListExtensions.IsNotNullAndNotEmpty{T}(IEnumerable{T}?)"/>
public static bool IsNotNullAndNotEmpty<T>(this T[]? obj)
=> obj is not null && obj.Any();
} }