CollectionHelper.cs 620 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace TEAMModelOS.SDK
  6. {
  7. public static class CollectionHelper
  8. {
  9. /// <summary>
  10. /// 判断集合是否不为空
  11. /// </summary>
  12. /// <param name="collection"></param>
  13. /// <returns></returns>
  14. public static bool IsNotEmpty(this ICollection collection)
  15. {
  16. if (collection != null && collection.Count > 0)
  17. {
  18. return true;
  19. }
  20. else
  21. {
  22. return false;
  23. }
  24. }
  25. }
  26. }