using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace TEAMModelOS.SDK
{
public static class CollectionHelper
{
///
/// 判断集合是否为空
///
///
///
public static bool IsEmpty(this IEnumerable collection)
{
if (collection != null && collection.Any())
{
return false;
}
else
{
return true;
}
}
///
/// 判断集合是否不为空
///
///
///
public static bool IsNotEmpty(this IEnumerable collection)
{
if (collection != null && collection.Any())
{
return true;
}
else
{
return false;
}
}
/////
///// 判断集合是否为空
/////
/////
/////
//public static bool IsEmpty(this ICollection collection)
//{
// if (collection != null && collection.Count > 0)
// {
// return false;
// }
// else
// {
// return true;
// }
//}
/////
///// 判断集合是否不为空
/////
/////
/////
//public static bool IsNotEmpty(this ICollection collection)
//{
// if (collection != null && collection.Count > 0)
// {
// return true;
// }
// else
// {
// return false;
// }
//}
}
}