namespace MES.Service.util; public class CollectionUtil { /** * 判断集合是否为空 * 为空时返回true */ public static bool IsNullOrEmpty(List list) { return list == null || list.Count == 0; } /** * 判断数组是否为空 * 为空时返回true */ public static bool IsNullOrEmpty(T[] array) { return array == null || !array.Any(); } }