diff --git a/UniversalExtensions.cs b/UniversalExtensions.cs index f71caef..deff631 100644 --- a/UniversalExtensions.cs +++ b/UniversalExtensions.cs @@ -22,6 +22,11 @@ public static class UniversalExtensions int rng = new Random().Next(0, obj.Count()); return obj.ElementAt(rng) ?? throw new ArgumentNullException(); } + + public static bool IsNotNullAndNotEmpty(this IEnumerable obj) + { + return obj is not null && obj.Any(); + } /// /// Get the current CPU Usage on all plattforms