ListTool.cs 748 B

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