IEnumerablenumbers = null; double average = numbers.AverageOrDefault(); if (average == double.NaN) { Console.WriteLine("The collection is null or empty."); }
double[] numbers = null; double average = numbers.AverageOrDefault(); if (average == double.NaN) { Console.WriteLine("The array is null or empty."); }The package library that contains the Aver IsNull method is likely "System.Linq" since the example code above showcases the use of IEnumerable