ListTool.cs 685 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace Y.Utils.BaseUtils
  4. {
  5. public class ListTool
  6. {
  7. public static bool IsNullOrEmpty(List<string> list)
  8. {
  9. if (list != null && list.Count() > 0)
  10. return false;
  11. return true;
  12. }
  13. public static bool IsNullOrEmpty<T>(List<T> list)
  14. {
  15. if (list != null && list.Count() > 0)
  16. return false;
  17. return true;
  18. }
  19. public static bool IsNullOrEmpty<T>(IEnumerable<T> list)
  20. {
  21. if (list != null && list.Count() > 0)
  22. return false;
  23. return true;
  24. }
  25. }
  26. }