|
|
@ -7,12 +7,20 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
|
|
|
namespace Soul2.General.utils { |
|
|
|
namespace Soul2.General.utils { |
|
|
|
public class CollectionsUtils { |
|
|
|
public class CollectionsUtils { |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 判断非空 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="collection">集合对象</param> |
|
|
|
|
|
|
|
/// <returns>是否非空</returns> |
|
|
|
public static bool isNotEmpty(IEnumerable collection) { |
|
|
|
public static bool isNotEmpty(IEnumerable collection) { |
|
|
|
return !isEmpty(collection); |
|
|
|
return !isEmpty(collection); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 判断为空 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="collection">集合对象</param> |
|
|
|
|
|
|
|
/// <returns>是否为空</returns> |
|
|
|
public static bool isEmpty(IEnumerable collection) { |
|
|
|
public static bool isEmpty(IEnumerable collection) { |
|
|
|
if (collection == null) { |
|
|
|
if (collection == null) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|